}\r
}\r
\r
- private class Visibility\r
- {\r
- public Control Control { get; }\r
- public bool Visible { get; }\r
-\r
- public Visibility(Control control, bool visible)\r
- {\r
- Control = control;\r
- Visible = visible;\r
- }\r
- }\r
-\r
private void SetHeaderVisibility()\r
{\r
- var headers = new[]\r
+ static void Set(Control header, bool visible)\r
{\r
- new Visibility(panelItemHeader, InItemList || InAntiAir || InBattleResult || InMiscText),\r
- new Visibility(panelGroupHeader, InGroupConfig),\r
- new Visibility(panelRepairHeader, InRepairList),\r
- new Visibility(panelFleetHeader, InFleetInfo)\r
- };\r
- foreach (var header in headers)\r
- {\r
- header.Control.Visible = header.Visible;\r
- if (header.Visible)\r
- header.Control.BringToFront();\r
+ header.Visible = visible;\r
+ if (visible)\r
+ header.BringToFront();\r
}\r
+\r
+ Set(panelItemHeader, InItemList || InAntiAir || InBattleResult || InMiscText);\r
+ Set(panelGroupHeader, InGroupConfig);\r
+ Set(panelRepairHeader, InRepairList);\r
+ Set(panelFleetHeader, InFleetInfo);\r
}\r
\r
private void SetPanelVisibility()\r
{\r
- var panels = new[]\r
- {\r
- new Visibility(shipListPanel, InShipStatus || InGroupConfig || InRepairList),\r
- new Visibility(itemTreeView, InItemList),\r
- new Visibility(fleetPanel, InFleetInfo),\r
- new Visibility(antiAirPanel, InAntiAir),\r
- new Visibility(airBattleResultPanel, InBattleResult),\r
- new Visibility(battleResultPanel, InBattleResult),\r
- new Visibility(richTextBoxMiscText, InMiscText)\r
- };\r
- foreach (var panel in panels)\r
+ static void Set(Control panel, bool visible)\r
{\r
// SwipeScrollifyが誤作動するのでEnabledも切り替える\r
- panel.Control.Visible = panel.Control.Enabled = panel.Visible;\r
+ panel.Visible = panel.Enabled = visible;\r
}\r
+\r
+ Set(shipListPanel, InShipStatus || InGroupConfig || InRepairList);\r
+ Set(itemTreeView, InItemList);\r
+ Set(fleetPanel, InFleetInfo);\r
+ Set(antiAirPanel, InAntiAir);\r
+ Set(airBattleResultPanel, InBattleResult);\r
+ Set(battleResultPanel, InBattleResult);\r
+ Set(richTextBoxMiscText, InMiscText);\r
}\r
\r
public void UpdateAirBattleResult()\r