public static void Init(bool singleInstance = false) { if (Thread.CurrentThread.Name == null) { Thread.CurrentThread.Name = "MainThread"; } //var a = Assembly.GetCallingAssembly(); //Trace.Assert(a != null); if (singleInstance && !GlobalInstance.IsSingle()) { var msg = new MsgBox { iconType = MsgBox.IconType.Error, Title = "ExchangeTime" }; msg.Show("Another instance is running!"); Environment.Exit(-1); } InitExceptionHandlers(); }
public static void Exit() => GlobalInstance.DisposeMutex(); // automatically disposed when the process ends; probably