nikhilk/scriptsharp — Issue #140: MultiCastDelegate InvocationList
Author: dax70
Created: 2012-01-10 06:49:59+00:00
State: open

Without exposing the invocation list, things like CancelEventArgs or wrapping jQueryEvent or DomEvent is nearly impossible.

```C#
public class MultiCastDelegate
{
// Missing from S# implementation
public sealed override Delegate[] GetInvocationList();
}
```

Needed for 'Cancelable' patterns.

```C#
protected internal void OnItemClick(ItemClickEventArgs e)
{
bool cancel = false;
EventHandler handler = this.ItemClick;
if (handler != null)
{
foreach (EventHandler subscriber in handler.GetInvocationList())
{
subscriber(this, args);
if (args.Cancel)
{
cancel = true;
break;
}
}
}
if (!cancel) { /* ... */ }
}
```