static void Main() { // Add event handlers to Show event. _show += new Program.EventHandler(Cat); _show += new Program.EventHandler(Dog); _show += new Program.EventHandler(Mouse); _show += new Program.EventHandler(Mouse); // Invoke the event. //d1.Invoke(); //if (_show != null) { // _show(); //} _show?.Invoke(); }
private static extern bool SetConsoleCtrlHandler(Program.EventHandler handler, bool add);