0

我有一个代表

public delegate bool Controller_PDF_FileDone(object sender, 
  ControllerTaskEventArgs e);

还有一个事件

public event Controller_PDF_FileDone On_Controller_PDF_FileDone;

我需要使用这个“事件”来调用该方法,请告诉我如何。

提前致谢

4

1 回答 1

2

调用事件(来自声明它的同一类):

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);
于 2013-06-27T12:01:23.843 回答