From 7b490d773386e7f9c19dec283ed8bdd9895daf97 Mon Sep 17 00:00:00 2001 From: Kazuhiro Fujieda Date: Sun, 2 May 2021 15:52:46 +0900 Subject: [PATCH] =?utf8?q?OS=E5=86=8D=E8=B5=B7=E5=8B=95=E6=99=82=E3=81=AB?= =?utf8?q?=E4=B8=80=E8=A6=A7=E3=82=A6=E3=82=A3=E3=83=B3=E3=83=89=E3=82=A6?= =?utf8?q?=E3=81=8C=E5=85=A8=E9=83=A8=E4=BF=9D=E5=AD=98=E3=81=95=E3=82=8C?= =?utf8?q?=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92=E7=9B=B4=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- KancolleSniffer/Forms/ListFormGroup.cs | 11 +++++++++++ KancolleSniffer/MainWindow.cs | 1 + 2 files changed, 12 insertions(+) diff --git a/KancolleSniffer/Forms/ListFormGroup.cs b/KancolleSniffer/Forms/ListFormGroup.cs index 0cb956c..e9d58a7 100644 --- a/KancolleSniffer/Forms/ListFormGroup.cs +++ b/KancolleSniffer/Forms/ListFormGroup.cs @@ -100,5 +100,16 @@ namespace KancolleSniffer.Forms foreach (var listForm in _listForms) action(listForm); } + + public void WaitForCloseAll() + { + var start = DateTime.Now; + do + { + Application.DoEvents(); + if (_listForms.All(listFrom => !listFrom.Visible)) + return; + } while ((DateTime.Now - start).TotalSeconds < 5); + } } } \ No newline at end of file diff --git a/KancolleSniffer/MainWindow.cs b/KancolleSniffer/MainWindow.cs index 0b1460d..4b4fc85 100644 --- a/KancolleSniffer/MainWindow.cs +++ b/KancolleSniffer/MainWindow.cs @@ -256,6 +256,7 @@ namespace KancolleSniffer } if (!SystemShutdown) _listFormGroup.Close(); // 各自で終了処理するのでシャットダウン時は不要 + _listFormGroup.WaitForCloseAll(); Config.Location = (Form.WindowState == FormWindowState.Normal ? Form.Bounds : Form.RestoreBounds).Location; Config.ShowHpInPercent = _c.fleetPanel.ShowHpInPercent; } -- 2.11.0