static bool HandleCtrl(Win32.CtrlTypes type) { var name = Enum.GetName(type.GetType(), type); Console.WriteLine("\nExiting due to {0} event from system!\n", name); if (f != null) f.TerminateBots(); return true; }
public void CopyFromWin32Struct(Win32.CMonitor.MONITORINFOEX monitorInfoEx) { foreach (PropertyInfo propInfo in monitorInfoEx.GetType().GetProperties()) { foreach (PropertyInfo propInfoSelf in GetType().GetProperties()) { if (propInfo.Name == propInfoSelf.Name) propInfoSelf.SetValue(this, propInfo.GetValue(monitorInfoEx, null), null); } } }