private void SolutionEventsOnOpened() { Enable.Command.Visible = true; ConfigurationWindowCommand.Command.Visible = true; if (Configuration == null) { Configuration = new ShieldSolutionConfiguration(); } UpdateExtensionEnabled(); }
protected override void OnSaveOptions(string key, Stream stream) { if (key != ShieldConfiguration || Configuration == null) { return; } try { ShieldSolutionConfiguration.Save(Configuration, stream); } catch (Exception ex) { MessageBox.Show($"Cannot save configuration.\r\n{ex.GetType().Name}: {ex.Message}"); } }
protected override void OnLoadOptions(string key, Stream stream) { if (key != ShieldConfiguration) { return; } try { Configuration = ShieldSolutionConfiguration.Load(stream); } catch (Exception e) { ThreadHelper.ThrowIfNotOnUIThread(); Configuration = new ShieldSolutionConfiguration(); WriteLine("An error occurred while loading the Shield configuration."); WriteLine($"{e.GetType().Name}: {e.Message}"); ActivePane(); } }