public delegate void ExecuteCallback();
class Executioner { private ExecuteCallback _doExecute;
public void AddMultiple()
{
// Add a delegate to MethodA
// This will work even if _doExecute is currently null
_doExecute += new Execute( MethodA );
// Add a delegate to MethodB also
_doExecute += new Execute( MethodB );
// Add a delegate to MethodC also
_doExecute += new Execute( MethodC );
}
public void MethodA()
{
//...
}
public void MethodB()
{
//...
}
public void MethodC()
{
//...
}
}