Support for in-memory profile refresh without ActivePrinterChanged event

- Issue MatterHackers/MCCentral#178
This commit is contained in:
John Lewin 2016-07-08 07:28:00 -07:00
parent 8aac9090f2
commit e0f66cd901

View file

@ -80,6 +80,20 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
}
}
public static void RefreshActiveInstance(SettingsProfile updatedProfile)
{
bool themeChanged = activeInstance.GetValue("active_theme_index") != updatedProfile.GetValue("active_theme_index");
activeInstance = updatedProfile;
if (themeChanged)
{
SwitchToPrinterTheme(true);
}
UiThread.RunOnIdle(ApplicationController.Instance.ReloadAdvancedControlsPanel);
}
/// <summary>
/// Switches to the ActivePrinter theme without firing the ThemeChanged event. This is useful when changing printers and
/// allows the theme state to be updated before the ActivePrinterChanged event fires, resulting in a single ReloadAll