J
jquerijero
Guest
As Brian alluded to, a class wrapper has the basic structure. 1. Define a Delegate for SomeMethodDelegate(SomeParemeter) 2. Public property of type Control (or any method to pass a form or widget) 3. Component that fires event on a different thread 4. Event Handler for Component's event Inside call SomeMethod(SomeParameter) 5. SomeMethod(SomeParameter) if form.InvokeRequired form.Invoke(new SomeMethodDelegate(SomeMethod), new object[] { SomeParameter }) else you can either call a public method of form passing SomeParameter or you can raise a custom event passing SomeParameter (I prefer this approach) NOTE: if you define a delegate with the same signature as Event Handler, you won't need a separate SomeMethod
Continue reading...
Continue reading...