示例#1
0
        public void ToggleConsoleWindow()
        {
            var response = new LauncherResponse()
            {
                Action = LauncherAction.ToggleConsole,
            };

            SendResponse(response);
        }
示例#2
0
        private void UpdateActiveHandles()
        {
            var response = new LauncherResponse()
            {
                Action        = LauncherAction.UpdateHandles,
                ActiveHandles = GetActiveHandles().Select(h => h.ToInt64()).ToList(),
            };

            SendResponse(response);
        }
示例#3
0
        public void SendLogToConsole(string message)
        {
            var response = new LauncherResponse()
            {
                Action  = LauncherAction.Log,
                Message = message,
            };

            SendResponse(response);
        }
示例#4
0
        public void Quit()
        {
            var response = new LauncherResponse()
            {
                Action = LauncherAction.Quit,
            };

            SendResponse(response);

            CleanupAndExit();
        }
示例#5
0
        public void Restart()
        {
            SaveState();
            var response = new LauncherResponse()
            {
                Action = LauncherAction.Restart,
            };

            SendResponse(response);

            CleanupAndExit();
        }
示例#6
0
        private void HandleDisplaySettingsChanged(object sender, EventArgs e)
        {
            SaveState();
            var response = new LauncherResponse()
            {
                Action  = LauncherAction.RestartWithMessage,
                Message = "A display settings change has been detected, which has automatically disabled workspacer. Press 'restart' when ready.",
            };

            SendResponse(response);

            CleanupAndExit();
        }
示例#7
0
        public void QuitWithException(Exception e)
        {
            var message  = e.ToString();
            var response = new LauncherResponse()
            {
                Action  = LauncherAction.QuitWithException,
                Message = message,
            };

            SendResponse(response);

            CleanupAndExit();
        }
示例#8
0
        private void SendResponse(LauncherResponse response)
        {
            var str = JsonConvert.SerializeObject(response);

            _pipeServer.SendResponse(str);
        }