From 2e9aa096e23ee78c8ebd0ef0efb18ab77e2bbaab Mon Sep 17 00:00:00 2001 From: John Lewin Date: Tue, 16 Oct 2018 17:36:50 -0700 Subject: [PATCH] Simplify --- MatterControlLib/PartPreviewWindow/Tabs.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/MatterControlLib/PartPreviewWindow/Tabs.cs b/MatterControlLib/PartPreviewWindow/Tabs.cs index 48c6386b6..96210ffc1 100644 --- a/MatterControlLib/PartPreviewWindow/Tabs.cs +++ b/MatterControlLib/PartPreviewWindow/Tabs.cs @@ -407,7 +407,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { UiThread.RunOnIdle(() => { - if (TabContent is PrinterTabPage printerTab + if (this.TabContent is PrinterTabPage printerTab && printerTab.printer.Connection.PrinterIsPrinting) { StyledMessageBox.ShowMessageBox( @@ -428,13 +428,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow "Cancel Print".Localize(), "Continue Printing".Localize()); } - else // need to handle asking about saving a + else { - UiThread.RunOnIdle(() => - { - this.parentTabControl.RemoveTab(this); - this.CloseClicked?.Invoke(this, null); - }); + this.parentTabControl.RemoveTab(this); + this.CloseClicked?.Invoke(this, null); } }); }