public class Test
{
public static void Do()
{
DictionaryEvents<string, string> dict = new DictionaryEvents<string, string>();
CollectionEvents<string> coll = new CollectionEvents<string>();
EventHandler<BeforeAddRemoveEventArgs<KeyValuePair<string, string>>> handler = delegate { throw new InvalidOperationException(string.Format("Whoops!")); };
dict.BeforeAddRemove += handler;
coll.BeforeAddRemove += handler;
}
}