Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个代表
public delegate bool Controller_PDF_FileDone(object sender, ControllerTaskEventArgs e);
还有一个事件
public event Controller_PDF_FileDone On_Controller_PDF_FileDone;
我需要使用这个“事件”来调用该方法,请告诉我如何。
提前致谢
调用事件(来自声明它的同一类):
var e = On_Controller_PDF_FileDone; if (e != null) { e.Invoke(this, new ControllerTaskEventArgs()); }
订阅一个事件(来自声明它的同一个类):
On_Controller_PDF_FileDone += new Controller_PDF_FileDone( YourHandlingMethod_On_Controller_PDF_FileDone);