コード例 #1
0
        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();
            }));
        }
コード例 #2
0
        private void radioButtonIsNotEnabled_SelectionGained(object sender, EventArgs e)
        {
#if !DEMO
            radioButtonIsEnabled.IsSelected = false;
            BroadcastServerSocket.IsEnabled = false;
            if (BroadcastServerSocket.IsRunning)
            {
                BroadcastServerSocket.Stop();
            }
#endif
        }
コード例 #3
0
        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
        }