Darren
Wed Mar 01 17:50:12 CST 2006
Ok figured it out; found what i was looking for on code project. He's my
refactord version of the code. I HAVE NOT TESTED THIS CODE, use at your own
risk. You'll have to change the "Invoke" method to match want you want to
do. More of a quick and dirty solution as i only need to do it with one
method/class
link that helped out
http://www.codeproject.com/netcf/UsingMyXamlCF.asp
public class CreateMyDelegate
{
object _eventTarget;
MethodInfo _method;
private CreateMyDelegate(MethodInfo method, object eventTarget)
{
_eventTarget = eventTarget;
_method = method;
}
private bool Invoke(Pram1 pram1, string detail, params object[] data)
{
object[] items = new object[] { parm1, detail, data };
return (bool)_method.Invoke(_eventTarget, items);
}
public static MyDelegate CreateDelegate(MethodInfo method, object
eventTarget)
{
CreateMyDelegate del = new CreateMyDelegate(method,eventTarget);
MyDelegate result = new MyDelegate(del.Invoke);
return result;
}
}
"Darren Coleman" <nothanks@spam.com> wrote in message
news:%23ZQ5eiXPGHA.3984@TK2MSFTNGP14.phx.gbl...
>I was wondering if anyone had a work around for Delegate.CreateDelegate?
>That method isn't in CF2.0. I'm just porting some .net code over CF2.0
>
> sample code i'm working on
>
> MyDelegate instanceOfMyDelegate = (MyDelegate )
> Delegate.CreateDelegate(typeof(MyDelegate ), this._parent, meth.Name);
>
>