public static void ShutdownApplication(bool showTaskbar = true) { IsAppShuttingDown = true; LocalSetting.Update(); #if !DEMO if (LocalSetting.Values.String["StartBroadcastServer"] != null) { BroadcastServerSocket.Stop(); } BroadcastClientSocket.Stop(); #endif if (TaskManagerServiceHelper.IsStarted) { TaskManagerServiceHelper.IsTaskManagerDisabled = false; } if (ConfigurationManager.UseKeyboardHook) { UserControlManager.Disable(); } if (showTaskbar) { UserControlManager.ShowTaskbar(true); } Logger.WriteLog("Exiting application"); Logger.CloseLog(); TemPOS.MainWindow.Singleton.AllowClose = true; TemPOS.MainWindow.Singleton.Dispatcher.Invoke((Action)(() => { TemPOS.MainWindow.Singleton.Closed += SingletonClosed; TemPOS.MainWindow.Singleton.Close(); })); }
private void radioButtonIsNotEnabled_SelectionGained(object sender, EventArgs e) { #if !DEMO radioButtonIsEnabled.IsSelected = false; BroadcastServerSocket.IsEnabled = false; if (BroadcastServerSocket.IsRunning) { BroadcastServerSocket.Stop(); } #endif }
private void textBoxPort_CommitEdit(object sender, EventArgs e) { // Broadcast Server #if !DEMO BroadcastServerSocket.Port = GetPort(); if ((BroadcastServerSocket.IsEnabled) && (BroadcastServerSocket.Port != null)) { if (BroadcastServerSocket.IsRunning) { BroadcastServerSocket.BroadcastMessage("ServerPortMayHaveChanged"); BroadcastServerSocket.Stop(); } BroadcastServerSocket.Start(); } #endif }