void SystemShuttingDown() { Utility.Configuration.Config.FormShipGroup.SplitterDistance = splitContainer1.SplitterDistance; Utility.Configuration.Config.FormShipGroup.AutoUpdate = MenuGroup_AutoUpdate.Checked; Utility.Configuration.Config.FormShipGroup.ShowStatusBar = MenuGroup_ShowStatusBar.Checked; //以下は実データがないと動作しないためなければスキップ if (KCDatabase.Instance.Ships.Count == 0) { return; } ShipGroupManager groups = KCDatabase.Instance.ShipGroup; if (SelectedTab != null) { ApplyGroupData(SelectedTab); } List <ImageLabel> list = TabPanel.Controls.OfType <ImageLabel>().OrderBy(c => TabPanel.Controls.GetChildIndex(c)).ToList(); for (int i = 0; i < list.Count; i++) { ShipGroupData group = groups[(int)list[i].Tag]; if (group != null && group.GroupID >= 0) { group.GroupID = i + 1; } } }
private void FormShipGroup_Load(object sender, EventArgs e) { ShipGroupManager groups = KCDatabase.Instance.ShipGroup; if (!groups.ShipGroups.ContainsKey(-1)) { var master = new ShipGroupData(-1); master.Name = "全所属艦"; master.ColumnFilter = Enumerable.Repeat <bool>(true, ShipView.Columns.Count).ToList(); master.ColumnWidth = ShipView.Columns.OfType <DataGridViewColumn>().Select(c => c.Width).ToList(); groups.ShipGroups.Add(master); } foreach (var g in groups.ShipGroups.Values) { TabPanel.Controls.Add(CreateTabLabel(g.GroupID)); } { int columnCount = ShipView.Columns.Count; for (int i = 0; i < columnCount; i++) { ShipView.Columns[i].Visible = false; } } ConfigurationChanged(); APIObserver o = APIObserver.Instance; o.APIList["api_port/port"].ResponseReceived += APIUpdated; o.APIList["api_get_member/ship2"].ResponseReceived += APIUpdated; Utility.Configuration.Instance.ConfigurationChanged += ConfigurationChanged; Icon = ResourceManager.ImageToIcon(ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormShipGroup]); }