You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
827 B
36 lines
827 B
#if FAT |
|
|
|
using System.ComponentModel; |
|
|
|
namespace LinqInternal.Collections.ThreadSafe |
|
{ |
|
[System.Diagnostics.DebuggerNonUserCode] |
|
internal class WeakCancellableEvent<TCancelEventArgs> : WeakEvent<TCancelEventArgs> |
|
where TCancelEventArgs : CancelEventArgs |
|
{ |
|
public WeakCancellableEvent() |
|
{ |
|
//Empty |
|
} |
|
|
|
public WeakCancellableEvent(bool reentryGuard) |
|
: base(reentryGuard) |
|
{ |
|
//Empty |
|
} |
|
|
|
public override void Invoke(object sender, TCancelEventArgs eventArgs) |
|
{ |
|
foreach (var handler in EventHandlers) |
|
{ |
|
handler.DynamicInvoke(eventArgs); |
|
if (eventArgs.Cancel) |
|
{ |
|
break; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
#endif |