且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检查事件是否已加载?

更新时间:2022-06-25 07:41:45

除非你拥有公共事件的类,没有强大的

方式这样做。但是,如果你已经订阅了这个事件(并且它没有错误),那么很可能它工作正常并且

DataSourceChanged支持者(至少) 1名代表。


你能否提供一些不起作用的案例?它更可能是特定于您的使用/期望。


Marc

Unless you "own" the class publichsing the event, there is no robust
way of doing this. However, if you have subscribed to the event (and it
didn''t error) then chances are that it worked fine and the
DataSourceChanged backer has (at least) 1 delegate.

Can you give any more details on the one case where it doesn''t work? It
is more likely to be specific to your usage / expectations.

Marc


除非你拥有公共活动的课程


你自己上课的意思是什么?我已经创建了所有涉及的代码。


事件在一个案例中没有触发。我知道因为

中的断点,委托方法永远不会在一个案例中被击中。我想提供

的详细信息,但这需要大量的解释。如果只有一个

的方式来检查一个事件的调用列表,那将是一个好的开始。


谢谢,

Brett

Unless you "own" the class publichsing the event

What do you mean by own the class? I''ve created all the code involved.

The event isn''t firing in the one case. I know because a breakpoint in
the delegated method is never hit in the one case. I''d like to give
details but it would require lots of explaining. If there is just a
way to check the invocation list for the one event, that would be a
good start.

Thanks,
Brett


我的意思是DataGrid,所以没有:你不是。不,没有。

I mean DataGrid, so no: you don''t. And no there isn''t.