C
CJ Taylor
What does this mean?
This method creates delegates for static methods only. An instance method is
a method that is associated with an instance of a class; a static method is
a method that is associated with the class itself.
So I'm trynig to use System.Delegate.CreateDelegate (Type, MethodInfo) :
Delegate and having some issues...
I have the following code
evtInfo = objHolder.GetType().GetEvent(eRow.EvtName)
methInfo = objTarget.GetType().GetMethod(eRow.TargetDelegate)
delTemp = System.Delegate.CreateDelegate(evtInfo.EventHandlerType, methInfo)
evtInfo.AddEventHandler(objHolder, delTemp)
and have no idea what I'm doing wrong. I keep getting that there is an
ArgumentException where methinfo needs to be a static method... And there is
not a bit of documentation on this.
Now, if I understand this correctly, and understand the word "static" I
understand that to be Shared in VB.NET, would that be the correct
assumption? Or am I just completly wrong in this matter.
I've been reading a lot on this, and I want to be able to release a
framework for Windows Forms for others to use, but can't get past these
little issues. That and if you ever have a complex quesiotn I can answer
it. =)
Hopefully someone is more familar with this than I am.
Thanks again,
CJ
This method creates delegates for static methods only. An instance method is
a method that is associated with an instance of a class; a static method is
a method that is associated with the class itself.
So I'm trynig to use System.Delegate.CreateDelegate (Type, MethodInfo) :
Delegate and having some issues...
I have the following code
evtInfo = objHolder.GetType().GetEvent(eRow.EvtName)
methInfo = objTarget.GetType().GetMethod(eRow.TargetDelegate)
delTemp = System.Delegate.CreateDelegate(evtInfo.EventHandlerType, methInfo)
evtInfo.AddEventHandler(objHolder, delTemp)
and have no idea what I'm doing wrong. I keep getting that there is an
ArgumentException where methinfo needs to be a static method... And there is
not a bit of documentation on this.
Now, if I understand this correctly, and understand the word "static" I
understand that to be Shared in VB.NET, would that be the correct
assumption? Or am I just completly wrong in this matter.
I've been reading a lot on this, and I want to be able to release a
framework for Windows Forms for others to use, but can't get past these
little issues. That and if you ever have a complex quesiotn I can answer
it. =)
Hopefully someone is more familar with this than I am.
Thanks again,
CJ