private static bool BreakEvent(int controlType)
{
if (controlType != Interop.Kernel32.CTRL_C_EVENT &&
controlType != Interop.Kernel32.CTRL_BREAK_EVENT)
{
return false;
}
return Console.HandleBreakEvent(controlType == Interop.Kernel32.CTRL_C_EVENT ? ConsoleSpecialKey.ControlC : ConsoleSpecialKey.ControlBreak);
}
}