예제 #1
0
		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);
		}
예제 #2
0
		private static void AEventHandler(Object sender, AEventArgs e)
		{
			e.Handled = true;
		}