public static void Main() { FooHandler foo = delegate { Foo += OnFooTest; }; }
public Y(Z a) : base(a.A) { this.a = a; FooHandler handler = delegate { a.Hello(); }; }
public ShellWindow() { handler += new FooHandler(FooHandled); InitializeComponent(); handler(10); }
static int Main() { fooref = new FooHandler (OnFoo); foo_start_crash (fooref); while (!ok) { Thread.Sleep (2000); } if (_foo != 22) return 1; return 0; }
static void Main(string[] args) { HttpMessageHandler handler = new HttpClientHandler(); handler = new BazHandler { InnerHandler = handler }; handler = new BarHandler { InnerHandler = handler }; handler = new FooHandler { InnerHandler = handler }; HttpClient httpClient = new HttpClient(handler); HttpResponseMessage response = httpClient.GetAsync("http://www.asp.net").Result; Console.Read(); }
public void can_register_for_an_event() { FooHandler handler = new FooHandler(); Bus.Register(handler); var fooEvent = new FooEvent(); Bus.Raise(fooEvent); handler.EventsCaught.ElementsShouldEqual(fooEvent); }
static void Main(string[] args) { Foo f = new Foo(); f.Value = 1; FooHandler handler = new FooHandler(); handler.Serialize(f); Console.ReadKey(); }
public void Can_register_multiple_handlers() { var handler1 = new FooHandler(); var handler2 = new FooHandler(); Bus.Register(handler1); Bus.Register(handler2); var fooEvent = new FooEvent(); Bus.Raise(fooEvent); handler1.EventsCaught.ElementsShouldEqual(fooEvent); handler2.EventsCaught.ElementsShouldEqual(fooEvent); }
public void forward_same_command_to_multiple_different_handlers() { var venga = new Venga(); var command = new FooCommand(); var aFooHandler = new FooHandler(); var anotherFooHandler = new OtherFooHandler(); venga.RegisterHandler(aFooHandler); venga.RegisterHandler(anotherFooHandler); venga.Handle(command); Assert.True(command.WasHandledBy.Any(handler => handler is FooHandler)); Assert.True(command.WasHandledBy.Any(handler => handler is OtherFooHandler)); }
public void Multiple_handlers_handler_can_handle_an_event() { var fooBarBazHandler = new FooBarBazHandler(); var fooHandler = new FooHandler(); Bus.Register(fooBarBazHandler); Bus.Register(fooHandler); var fooEvent = new FooEvent(); var barEvent = new BarEvent(); var bazEvent = new BazEvent(); Bus.Raise(fooEvent); Bus.Raise(barEvent); Bus.Raise(bazEvent); fooBarBazHandler.EventsCaught.ElementsShouldEqual(fooEvent, barEvent, bazEvent); fooHandler.EventsCaught.ElementsShouldEqual(fooEvent); }
private static extern void foo_start_crash (FooHandler handler);
public X() { Foo += new FooHandler(foo); Foo += new FooHandler(boston); }
public static void Main () { object o = new FooHandler (foo); ((FooHandler) o) (); }
public static void Main() { object o = new FooHandler(foo); ((FooHandler)o)(); }
public X() { Foo += new FooHandler (foo); Foo += new FooHandler (boston); }