public void UnknownEventArgs() { var events = new EventHandlers<String>(this); Boolean firstAdded = events.Add<AEventArgs>("v", AEventHandler); Assert.IsTrue(firstAdded); firstAdded = events.Add<AEventArgs>("v", AEventHandler); Assert.IsFalse(firstAdded); EventArgs e = new AEventArgs(); events.Raise("v", e); Assert.IsTrue(((AEventArgs)e).Handled); e = new BEventArgs(); events.Raise("v", e); Assert.IsTrue(((BEventArgs)e).Handled); }
private static void AEventHandler(Object sender, AEventArgs e) { e.Handled = true; }