private static void AutoTimeStampPoll()
        {
            if ((!sw_recv_period_.IsRunning) ||
                (sw_recv_period_.ElapsedMilliseconds < ConfigManager.System.AutoTimeStamp.Value_LastRecvPeriod.Value)
                )
            {
                return;
            }

            GatePacketManager.SetTimeStamp(ConfigManager.Language.MainMessage.TimeStampAuto.Value);

            /* タイムスタンプの挿入でタイマーが開始してしまうので、必ずタイムスタンプ挿入の後に実行 */
            sw_recv_period_.Stop();
        }
Exemple #2
0
        public void FormKeyAction(MainWindowActionId id)
        {
            if (InvokeRequired)
            {
                Invoke((FormKeyActionHandler)FormKeyAction, id);
                return;
            }

            switch (id)
            {
            case MainWindowActionId.ApplicationExit:
                Program.ShutdownRequest();
                break;

            case MainWindowActionId.TimeStamp:
                GatePacketManager.SetTimeStamp(ConfigManager.Language.MainMessage.TimeStampManual.Value);
                break;

            case MainWindowActionId.PacketRedraw:
                FormTaskManager.RedrawPacketRequest();
                break;

            case MainWindowActionId.PacketClear:
                GatePacketManager.ClearPacket();
                break;

            case MainWindowActionId.PacketSaveConvertOff:
                FormUiManager.SavePacketLog(true, false);
                break;

            case MainWindowActionId.PacketSaveConvertOn:
                FormUiManager.SavePacketLog(true, true);
                break;

            case MainWindowActionId.PacketSaveAsConvertOff:
                FormUiManager.SavePacketLog(false, false);
                break;

            case MainWindowActionId.PacketSaveAsConvertOn:
                FormUiManager.SavePacketLog(false, true);
                break;

            case MainWindowActionId.FileOpen:
                FormUiManager.FileOpen();
                break;

            case MainWindowActionId.AutoTimeStampToggle:
                ConfigManager.System.AutoTimeStamp.Enable.Value = !ConfigManager.System.AutoTimeStamp.Enable.Value;
                FormUiManager.MainFrameMenuBarUpdate();
                break;

            case MainWindowActionId.AutoScrollToggle:
                ConfigManager.System.AutoScroll.Value = !ConfigManager.System.AutoScroll.Value;
                FormUiManager.MainFrameMenuBarUpdate();
                break;

            case MainWindowActionId.ProfileAdd:
                ConfigManager.CreateNewProfile("New Profile", null, true);
                break;

            case MainWindowActionId.ProfileRemove:
                ConfigManager.DeleteProfile(ConfigManager.GetCurrentProfileID());
                break;

            case MainWindowActionId.ProfileEdit:
                if (FormUiManager.ShowProfileEditDialog("Edit Profile", ConfigManager.User, ConfigManager.User.ProfileName.Value))
                {
                    ConfigManager.SaveCurrentProfile(true);
                    FormUiManager.MainFrameMenuBarUpdate();
                }
                break;

            case MainWindowActionId.ProfileExport:
                FormUiManager.SaveUserConfig();
                break;

            case MainWindowActionId.Gate1_Connect:
            case MainWindowActionId.Gate2_Connect:
            case MainWindowActionId.Gate3_Connect:
            case MainWindowActionId.Gate4_Connect:
            case MainWindowActionId.Gate5_Connect:
                var gate_list = GateManager.GetGateList();
                var gate_id   = (int)(id - MainWindowActionId.Gate1_Connect);

                if (gate_id < gate_list.Length)
                {
                    gate_list[gate_id].ConnectRequest = !gate_list[gate_id].ConnectRequest;
                }
                break;

            case MainWindowActionId.ShowScriptWindow:
                FormUiManager.ScriptWindowVisible(true);
                break;

            case MainWindowActionId.ShowOptionDialog:
                FormUiManager.ShowOptionDialog();
                break;

            case MainWindowActionId.ShowAppDocument:
                FormUiManager.ShowAppDocument();
                break;

            case MainWindowActionId.ShowAppDocument_PacketFilter:
                FormUiManager.ShowAppDocument();
                break;

            case MainWindowActionId.ShowAppInformation:
                FormUiManager.ShowAppInfo();
                break;
            }
        }