Beispiel #1
0
        private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
        {
            // Put your own handler here
            switch (ctrlType)
            {
                case CtrlTypes.CTRL_C_EVENT:
                    isClosing = true;
                    break;

                case CtrlTypes.CTRL_BREAK_EVENT:
                    isClosing = true;
                    break;

                case CtrlTypes.CTRL_CLOSE_EVENT:
                    isClosing = true;
                    break;

                case CtrlTypes.CTRL_LOGOFF_EVENT:
                case CtrlTypes.CTRL_SHUTDOWN_EVENT:
                    isClosing = true;
                    break;

            }
            return true;
        }
Beispiel #2
0
 public static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     switch (ctrlType)
     {
         case CtrlTypes.CTRL_C_EVENT:
             _log.Info("CTRL+C");
             _continue = false;
             break;
         case CtrlTypes.CTRL_BREAK_EVENT:
             _log.Info("BREAK");
             _continue = false;
             break;
         case CtrlTypes.CTRL_CLOSE_EVENT:
             _log.Info("CLOSE");
             _continue = false;
             break;
         case CtrlTypes.CTRL_LOGOFF_EVENT:
             _log.Info("LOGOFF");
             _continue = false;
             break;
         case CtrlTypes.CTRL_SHUTDOWN_EVENT:
             _log.Info("SHUTDOWN");
             _continue = false;
             break;
     }
     return true;
 }
Beispiel #3
0
        private static bool ConsoleControlCheck(CtrlTypes ctrlType)
        {
            switch (ctrlType)
            {
                case CtrlTypes.CTRL_C_EVENT:
                    isClosing = true;
                    Console.WriteLine("CTRL+C received");
                    break;
                case CtrlTypes.CTRL_BREAK_EVENT:
                    isClosing = true;
                    Console.WriteLine("CTRL BREAK received");
                    break;
                case CtrlTypes.CTRL_CLOSE_EVENT:
                    isClosing = true;
                    Console.WriteLine("CTRL CLOSE received");
                    break;
                case CtrlTypes.CTRL_LOGOFF_EVENT:
                    isClosing = true;
                    Console.WriteLine("LOGOFF detected");
                    break;
                case CtrlTypes.CTRL_SHUTDOWN_EVENT:
                    isClosing = true;
                    Console.WriteLine("Shutdown detected");
                    break;
            }

            Save();
            return true;
        }
Beispiel #4
0
 /// <summary>
 /// This method will be called if the user closes the console window or presses CTRL+C
 /// </summary>
 /// <param name="ctrlType"></param>
 /// <returns>always true</returns>
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     // TODO: implement exit handler routine
     Console.WriteLine("Handler");
     keepRunning = false;
     return true;
 }
Beispiel #5
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     if (_newSite != null) {
         Debug("Ctrl-C: Stopping site");
         _newSite.Stop();
     }
     return true;
 }
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     if (ctrlType.Equals(CtrlTypes.CTRL_C_EVENT))
     {
         _quit = true;
         return true;
     }
     return false;
 }
        private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
        {
            if (_onCheck != null)
            {
                _onCheck();
            }

            return false;
        }
        private static bool consoleCtrlHandler(CtrlTypes ctrltype)
        {
            if (ctrltype == CtrlTypes.CtrlCEvent)
            {
                _exitAtNextIteration = true;
                return true;
            }

            return false;
        }
        /// <summary>
        /// HandlerRoutine
        /// </summary>
        /// <param name="ctrlType"></param>
        /// <returns></returns>
        private bool myHandler(CtrlTypes ctrlType)
        {
            // Close serial port connection
            if (statusChecker.mySerialPort.IsOpen)
            {
                statusChecker.mySerialPort.Close();
            }

            return false;
        }
Beispiel #10
0
 static bool CtrlHandler(CtrlTypes EventType)
 {
     Domain_ProcessExit(null, null);
     if (EventType == CtrlTypes.CTRL_C_EVENT)
     {
         // Force exit
         Environment.Exit(3);
     }
     return true;
 }
Beispiel #11
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     switch (ctrlType)
     {
         case CtrlTypes.CTRL_CLOSE_EVENT:
             running = false;
             listener.sendPacket(new Packet999());
             break;
     }
     return true;
 }
Beispiel #12
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     switch (ctrlType)
     {
         case CtrlTypes.CTRL_CLOSE_EVENT:
             isclosing = true;
             CloseChatServer();
             break;
     }
     return true;
 }
Beispiel #13
0
		private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
		{
			if (ctrlType == CtrlTypes.CtrlCloseEvent ||
			    ctrlType == CtrlTypes.CtrlShutdownEvent)
			{
				QuitEvent.Set();

				return true;
			}

			return false;
		}
Beispiel #14
0
 private static bool ConsoleHandlerRoutine(CtrlTypes type)
 {
     switch (type) {
         case CtrlTypes.CTRL_C_EVENT:
         case CtrlTypes.CTRL_BREAK_EVENT:
         case CtrlTypes.CTRL_CLOSE_EVENT:
         case CtrlTypes.CTRL_LOGOFF_EVENT:
         case CtrlTypes.CTRL_SHUTDOWN_EVENT:
             StoppingProxy();
             break;
     }
     return true;
 }
Beispiel #15
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     switch (ctrlType)
     {
         case CtrlTypes.CTRL_C_EVENT:
         case CtrlTypes.CTRL_BREAK_EVENT:
         case CtrlTypes.CTRL_CLOSE_EVENT:
         case CtrlTypes.CTRL_LOGOFF_EVENT:
         case CtrlTypes.CTRL_SHUTDOWN_EVENT:
             Exit();
             return true;
     }
     return false;
 }
 private bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     switch (ctrlType)
     {
         case CtrlTypes.CTRL_C_EVENT:
         case CtrlTypes.CTRL_BREAK_EVENT:
         case CtrlTypes.CTRL_CLOSE_EVENT:
         case CtrlTypes.CTRL_LOGOFF_EVENT:
         case CtrlTypes.CTRL_SHUTDOWN_EVENT:
             if (Signaled != null)
                 Signaled(this, EventArgs.Empty);
             break;
     }
     return true;
 }
 // special event control handler
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     switch (ctrlType)
     {
         // in the case of any special events, shutdown
         case CtrlTypes.CTRL_C_EVENT:
         case CtrlTypes.CTRL_BREAK_EVENT:
         case CtrlTypes.CTRL_CLOSE_EVENT:
         case CtrlTypes.CTRL_LOGOFF_EVENT:
         case CtrlTypes.CTRL_SHUTDOWN_EVENT:
             shutdown();
             break;
     }
     return true;
 }
Beispiel #18
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     Other.saveInfo();
     return(true);
 }
Beispiel #19
0
 private static bool Handler(CtrlTypes ctrlType)
 {
     rc.stop();
     return(true);
 }
Beispiel #20
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     s_handler();
     return false;
 }
Beispiel #21
0
 bool myHandler(CtrlTypes ctrlType)
 {
     Imports.TC08Stop(handle);
     Imports.TC08CloseUnit(handle);
     return(false);
 }
Beispiel #22
0
 /// <summary>
 /// Windows用コンストラクタ
 /// </summary>
 /// <param name="ctrlTypes"></param>
 public SignalEventArgs(ExitSignal_Platform platform, CtrlTypes ctrlTypes)
 {
     m_platform  = platform;
     m_ctrlTypes = ctrlTypes;
 }
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     StopRedis();
     return true;
 }
Beispiel #24
0
 static extern bool GenerateConsoleCtrlEvent(CtrlTypes sigevent, int dwProcessGroupId);
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     ServiceStartup.Stop();
     return(false);
 }
Beispiel #26
0
 private static extern bool GenerateConsoleCtrlEvent(CtrlTypes ctrlEvent, uint processGroupId);
Beispiel #27
0
 internal static extern bool GenerateConsoleCtrlEvent(CtrlTypes dwCtrlEvent, uint dwProcessGroupId);
Beispiel #28
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     // Put your own handler here
     t1.Abort();
     return(true);
 }
Beispiel #29
0
 // 終了時の処理を行うためのハンドラルーチン
 private bool MyHandler(CtrlTypes ctrlType)
 {
     _mytwitchBot.End();
     Console.WriteLine("アプリケーションを終了します。");
     return(false);
 }
Beispiel #30
0
 private static bool __EXIT_HANDLER(CtrlTypes ctrlType)
 {
     __INTERN_EXIT();
     return(true);
 }
Beispiel #31
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     File.WriteAllText(@"C:\github\CEP\EDNE\cep.json", JsonConvert.SerializeObject(Ultimos));
     Thread.Sleep(2000);
     return(close = true);
 }
Beispiel #32
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     //TODO: implement exit handler routine
     Environment.Exit(5);
     return(true);
 }
 // Methods
 private static bool _ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     UnregisterNCover();
     return(false);
 }
Beispiel #34
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     service.StopService();
     return(true);
 }
Beispiel #35
0
 static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     // Put your own handler here
     return true;
 }
Beispiel #36
0
 public bool HandlerRoutine(CtrlTypes ctrlType)
 {
     _handler();
     return(true);
 }
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     StopRedis();
     return(true);
 }
Beispiel #38
0
 private static extern bool GenerateConsoleCtrlEvent(CtrlTypes dwCtrlEvent, uint dwProcessGroupId);
Beispiel #39
0
        //[DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
        //private static extern int mciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback);
        private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
        {
            // Put your own handling here:

            switch (ctrlType)
            {
                case CtrlTypes.CTRL_C_EVENT:

                    isclosing = true;

                    //CurrentDomain_ProcessExit(null, null);

                    break;

                case CtrlTypes.CTRL_BREAK_EVENT:

                    isclosing = true;

                    //CurrentDomain_ProcessExit(null, null);

                    break;

                case CtrlTypes.CTRL_CLOSE_EVENT:

                    isclosing = true;
                    CurrentDomain_ProcessExit(null, null);
                    break;

                case CtrlTypes.CTRL_LOGOFF_EVENT:
                case CtrlTypes.CTRL_SHUTDOWN_EVENT:

                    isclosing = true;

                    CurrentDomain_ProcessExit(null, null);

                    break;
            }

            return true;
        }
Beispiel #40
0
 // Methods
 private static bool _ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     UnregisterNCover();
     return false;
 }
Beispiel #41
0
        private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
        {
            // Put your own handler here
            switch (ctrlType)
            {
                case CtrlTypes.CTRL_C_EVENT:
                case CtrlTypes.CTRL_BREAK_EVENT:
                case CtrlTypes.CTRL_CLOSE_EVENT:
                case CtrlTypes.CTRL_LOGOFF_EVENT:
                case CtrlTypes.CTRL_SHUTDOWN_EVENT:
                    if (manager != null)
                    {
                        manager.StopBots();
                    }
                    isclosing = true;
                    break;
            }

            return true;
        }
Beispiel #42
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     _bootstrapper.Stop();
     return(true);
 }
Beispiel #43
0
        private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
        {
            _semaphore.Release();

            return(true);
        }
Beispiel #44
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     Cleanup();
     return(true);
 }
Beispiel #45
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     //TODO: implement exit handler routine
     Environment.Exit(5);
     return true;
 }
Beispiel #46
0
        private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
        {
            sw.Close();

            return(true);
        }
Beispiel #47
0
 private static bool consoleOnExit(CtrlTypes ctrlType)
 {
     exitServer();
     return true;
 }
Beispiel #48
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     System.Environment.Exit(1);
     return(true);
 }
Beispiel #49
0
 // ハンドラ・ルーチン
 bool myHandler(CtrlTypes ctrlType)
 {
     this._ctrlBT.Dispose();
     return false;
 }
Beispiel #50
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     cancellationTokenSource.Cancel();
     return(true);
 }
Beispiel #51
0
		private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
		{
			if (ctrlType == CtrlTypes.CtrlCloseEvent ||
			    ctrlType == CtrlTypes.CtrlShutdownEvent)
			{
				Logger.DebugWithLineNumber(WhoAmI + " : ConsoleCtrlCheck called.");

				QuitEvent.Set();

				return true;
			}

			return false;
		}
Beispiel #52
0
 // ハンドラ・ルーチン
 bool myHandler(CtrlTypes ctrlType)
 {
     this._ctrlBT.Dispose();
     return(false);
 }
Beispiel #53
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     ReleaseResourcesIfRequired();
     return(true);
 }
 private bool DefaultHandleConsoleExit(CtrlTypes ctrlType)
 {
     OnProcessExit(null, null);
     return(false);
 }
Beispiel #55
0
        /// <summary>        ///         /// </summary>        /// <param name="ctrlType"></param>        /// <returns></returns>      
        /// 
        private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
        {
            // Put your own handler here
            switch (ctrlType)            {
            case CtrlTypes.CTRL_C_EVENT:
            _userRequestExit = true;
            keepRunning = true;
            Console.WriteLine("CTRL+C received, shutting down");
            //Account a = new Account();

            userAccts.RequestStop();
            Console.WriteLine("User cancelled, shutting down");

            if (countdownEvent != null)
            {
                while ((countdownEvent.CurrentCount > 0))
                {
                    Console.WriteLine("signaling background workers");
                    countdownEvent.Signal(1);
                    Thread.Sleep(2000);

                }
            }

            Console.WriteLine("User cancelled, aborting down");
            System.Console.WriteLine("press an key to continue");
                Console.ReadKey(true);

               Thread.CurrentThread.Abort();

             break;

            case CtrlTypes.CTRL_BREAK_EVENT:
            _userRequestExit = true;
            Console.WriteLine("CTRL+BREAK received, shutting down");
            break;

            case CtrlTypes.CTRL_CLOSE_EVENT:
            _userRequestExit = true;
            Console.WriteLine("Program being closed, shutting down");
            break;

            case CtrlTypes.CTRL_LOGOFF_EVENT:
            case CtrlTypes.CTRL_SHUTDOWN_EVENT:
            _userRequestExit = true;
            Console.WriteLine("User is logging off!, shutting down");
            break;
            }
            return true;
        }
Beispiel #56
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     AggregatorLogger.Instance.Stop();
     return(true);
 }
Beispiel #57
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     ServiceStartup.Stop();
     return false;
 }
Beispiel #58
0
 private bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     Console.WriteLine("Stopping...");
     interrupted = true;
     return(true);
 }