我能否确定某个功能是否已分配给某个事件?
例如(带有网络浏览器控制的标准 winforms 应用程序)
namespace Crawler {
public partial class Form1 : Form {
WebCrawler.manager m;
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
system.windows.forms.webbrowser wb = new system.windows.forms.webbrowser();
wb.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(foo);
//[... Some other code ...]
/* [Begin Example] */
if (wb.DocumentCompleted.Contains(foo){
// Behave Normally
}else {
// Do Something Else...
}
}
}
}
而且,如果我可以做我上面描述的事情,那该怎么做?