Exemplo n.º 1
0
        private void SolutionEventsOnOpened()
        {
            Enable.Command.Visible = true;
            ConfigurationWindowCommand.Command.Visible = true;

            if (Configuration == null)
            {
                Configuration = new ShieldSolutionConfiguration();
            }

            UpdateExtensionEnabled();
        }
Exemplo n.º 2
0
        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}");
            }
        }
Exemplo n.º 3
0
        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();
            }
        }