Remove PreChangePanels event

This commit is contained in:
John Lewin 2017-06-13 13:43:51 -07:00
parent 12dc4de06f
commit 9112ef6cbd
3 changed files with 2 additions and 25 deletions

View file

@ -60,7 +60,6 @@ namespace MatterHackers.MatterControl
public void ReloadSliceSettings()
{
WidescreenPanel.PreChangePanels.CallEvents(null, null);
if (tabControl.HasBeenClosed)
{
return;

View file

@ -682,7 +682,6 @@ namespace MatterHackers.MatterControl
// give the widget a chance to hear about the close before they are actually closed.
PopOutManager.SaveIfClosed = false;
WidescreenPanel.PreChangePanels.CallEvents(this, null);
MainView?.CloseAllChildren();
using (new QuickTimer("ReloadAll_AddElements"))
{

View file

@ -30,13 +30,8 @@ either expressed or implied, of the FreeBSD Project.
using System;
using MatterHackers.Agg;
using MatterHackers.Agg.UI;
using MatterHackers.MatterControl.CustomWidgets;
using MatterHackers.MatterControl.PartPreviewWindow;
using MatterHackers.MatterControl.PrinterCommunication;
using MatterHackers.VectorMath;
using MatterHackers.Agg.Font;
using MatterHackers.Agg.Transform;
using MatterHackers.Agg.VertexSource;
namespace MatterHackers.MatterControl
{
@ -45,10 +40,6 @@ namespace MatterHackers.MatterControl
private TextImageButtonFactory advancedControlsButtonFactory = new TextImageButtonFactory();
private RGBA_Bytes unselectedTextColor = ActiveTheme.Instance.TabLabelUnselected;
private EventHandler unregisterEvents;
public static RootedObjectEventHandler PreChangePanels = new RootedObjectEventHandler();
public WidescreenPanel()
{
}
@ -74,7 +65,8 @@ namespace MatterHackers.MatterControl
SplitterBackground = ApplicationController.Instance.Theme.SplitterBackground
};
library3DViewSplitter.AnchorAll();
AddChild(library3DViewSplitter);
this.AddChild(library3DViewSplitter);
// put in the left column
library3DViewSplitter.Panel1.AddChild(new AdvancedControlsPanel()
@ -88,19 +80,6 @@ namespace MatterHackers.MatterControl
VAnchor = VAnchor.ParentBottom | VAnchor.ParentTop,
HAnchor = HAnchor.ParentLeft | HAnchor.ParentRight
});
ApplicationController.Instance.AdvancedControlsPanelReloading.RegisterEvent((s, e) => UiThread.RunOnIdle(ReloadAdvancedControlsPanel), ref unregisterEvents);
}
public override void OnClosed(ClosedEventArgs e)
{
unregisterEvents?.Invoke(this, null);
base.OnClosed(e);
}
public void ReloadAdvancedControlsPanel()
{
PreChangePanels.CallEvents(this, null);
}
}