【发布时间】:2010-08-19 10:21:29
【问题描述】:
public delegate void ExecuteCallback();
类刽子手 { 私有 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()
{
//...
}
}
【问题讨论】:
-
你的问题到底是什么?