![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I've a VSA implementation and I'm able to invoke any method in my script. Now I want to hook up event handler in the code from an external event source. Normally I use this: EventInfo eInfo = this.MyForm.GetType().GetEvent("EventName"); Delegate d = Delegate.CreateDelegate(eInfo, this, "Button_Click"); eInfo.AddEventHandler(this, d); "this" points to the class where "Button_Click" is available. This works very well. No I want the event handler, defined in my VSA script. EventInfo eInfo = this.MyForm.GetType().GetEvent("EventName"); Delegate d = Delegate.CreateDelegate(eInfo, MyVSA, "Button_Click"); eInfo.AddEventHandler(MyVSA, d); Question: How to get MyVSA? object MyVSA = vsaEngine.Assembly.INeedAMethodLike_GetRunningInst ance(); Any ideas? Or is there any other way to hook up script methods as event handlers for the host application? Thank you, Joerg |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |