private void UpdateTargetList() { CBox_TargetList.BeginUpdate(); { var target_now = CBox_TargetList.Text; CBox_TargetList.ClearItemGroup(); var group = (ComboBoxEx.ItemGroup)null; /* ゲート一覧のターゲットリスト */ group = CBox_TargetList.AddItemGroup(); group.Font = new Font(CBox_TargetList.Font.Name, CBox_TargetList.Font.Size, FontStyle.Bold); group.Items.Add("*"); foreach (var gate in GateManager.GetGateList()) { group.Items.Add(gate.Alias); } /* 過去設定値 */ group = CBox_TargetList.AddItemGroup(); foreach (var target in target_log_list_) { group.Items.Add(target); } CBox_TargetList.Text = target_now; } CBox_TargetList.EndUpdate(); }
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; } }