private void OnBeginRequest(object sender, EventArgs e) { var application = sender as HttpApplication; application.Context.Response.Write("Hello"); _eventHandler?.Invoke(this, null); }
static void Main(string[] args) { _show += new CustomEventHandler(Dog); _show += new CustomEventHandler(Cat); _show += new CustomEventHandler(Mouse); _show += new CustomEventHandler(Mouse); _show -= new CustomEventHandler(Cat); _show.Invoke(); }
public static void Raise(this CustomEventHandler handler) { handler?.Invoke(); }
public static void Raise <T>(this CustomEventHandler <T> handler, T arg) { handler?.Invoke(arg); }
public static void Raise <T, T1>(this CustomEventHandler <T, T1> handler, T arg, T1 arg2) { handler?.Invoke(arg, arg2); }
public static void Raise <T, T1, T2>(this CustomEventHandler <T, T1, T2> handler, T arg, T1 arg2, T2 arg3) { handler?.Invoke(arg, arg2, arg3); }