与 KeyPress 事件类似,我希望订阅该事件的人能够在我的 EventArgs 类中设置 e.Handled。如果它们返回 true,我不再想继续触发事件。任何想法如何实现这一点?现在,这是我的方法:
protected void OnDataReceived(SocketAsyncEventArgs e)
{
if (DataReceived != null)
{
DataReceived(this, e);
}
}
据我了解,每个订阅该事件的人都会收到通知,因此设置 e.Handled = true; 在这里不会有任何影响。