moMoney2009
Programmer
Is that possible. More specifically, can I create Delegate A which then is assigned to callback to Delegate B, BUT then also have Delegate B callback to a particular method?
keep in mind that I mean event delegates.
code example:
keep in mind with the "off the top" example i just wrote someone may be tempted to point out that what I am asking would be pointless since I could just assign the following
I would rather someone let that response slide and just know if what I proposed can work ... AND if not the way I coded it, then how do I properly do so?
Thanks
keep in mind that I mean event delegates.
code example:
Code:
public class classA
{
public event EventHandler Click;
}
Code:
public class classB
{
public event EventHandler classA_Click;
}
Code:
public class classC
{
public classC(classA a, classB b)
{
a.Click += b.classA_Click;
b.classA_Click += myMethod;
}
private void myMethod(object sender, EventArgs e)
{
System.Windows.Forms.MessageBox("callback successful");
}
}
keep in mind with the "off the top" example i just wrote someone may be tempted to point out that what I am asking would be pointless since I could just assign the following
Code:
a.Click += myMethod;
I would rather someone let that response slide and just know if what I proposed can work ... AND if not the way I coded it, then how do I properly do so?
Thanks