Dom,
Well, you have to have a delegate defined. It looks like it has no
parameters, and no return value, so you can define a delegate like so:
public void DoSomething();
Then, your constructor would be defined as:
public MyObject(Form originatingForm, DoSomething doSomething)
{
OriginatingForm.Invoke(doSomething);
}
Although if you know the object is going to be constructed on the UI
thread, then you can just do:
public MyObject(Form originatingForm, DoSomething doSomething)
{
doSomething();
}
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Dom" <do********@gmail.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
Let's say I do this:
MyObject o = new MyObject (this, DoWork);
... where DoThis is a function in the calling class. How do I pick
this up in the constructor, MyObject?
public MyObject (Form OriginatingForm, <???ptrDoWork)
OriginatingForm.Invoke (ptrDoWork)
How do I replace <???>.
Dom