コード例 #1
0
ファイル: AlexaCompGUI.cs プロジェクト: akmadian/AlexaComp
        /*
         * Handler for X button click.
         */
        protected override void OnFormClosing(FormClosingEventArgs e = null)
        {
            if (e != null)
            {
                base.OnFormClosing(e);
            }
            AlexaCompCore.Clog("CLOSING PROGRAM");
            AlexaCompCore.stopProgramFlag = true;
            AlexaCompSERVER.StopServer();
            AlexaCompSERVER.DelPortMap();

            Environment.Exit(1);
        }
コード例 #2
0
        public static void StopApplication()
        {
            Clog("CLOSING PROGRAM");
            stopProgramFlag = true;
            try {
                AlexaCompSERVER.StopServer();
            } catch (NullReferenceException) {
                Clog("NullReferenceException Caught When Stopping Server");
            } catch (Exception e) {
                Clog("Exception Caught When Stopping Server \n" + e);
            }

            try {
                AlexaCompSERVER.DelPortMap();
            } catch (NullReferenceException) {
                Clog("NullReferenceException Caught When Deleting Port Maps");
            } catch (Exception e) {
                Clog("Exception Caught When Deleting Port Maps\n" + e);
            }
            Clog("Exiting...");
            Environment.Exit(1);
        }