private void ThisAddIn_Startup(object sender, EventArgs e) { System.Windows.Forms.Application.EnableVisualStyles(); try { Settings.Default.Reload(); } catch (Exception exception) { MessageBox.Show($@"Unable to load addin settings {exception.Message}"); } if (Settings.Default.ReplaceDefaultHtmlReport) { RunReportHook.Install(); } _panelManager = new PanelManager(this); var version = int.Parse(Application.Version, NumberStyles.AllowDecimalPoint); if (version < 14) { AddinUI.StartupCommandBars("VisioHtmlSidebar", new[] { "TogglePanel", "Command2", }); } Application.SelectionChanged += Application_SelectionChanged; Application.OnKeystrokeMessageForAddon += _shortcutManager.OnKeystrokeMessageForAddon; }
private void ThisAddIn_Shutdown(object sender, EventArgs e) { if (Settings.Default.ReplaceDefaultHtmlReport) { RunReportHook.Uninstall(); } AddinUI.ShutdownCommandBars(); _panelManager.Dispose(); Application.SelectionChanged -= Application_SelectionChanged; Application.OnKeystrokeMessageForAddon -= _shortcutManager.OnKeystrokeMessageForAddon; }
private void buttonOK_Click(object sender, System.EventArgs e) { Settings.Default.PropertyName = textBoxPropertyName.Text; Settings.Default.PropertyNamePlainText = textBoxPropertyNamePlainText.Text; if (checkBoxReplaceHtmlReports.Checked != Settings.Default.ReplaceDefaultHtmlReport) { Settings.Default.ReplaceDefaultHtmlReport = checkBoxReplaceHtmlReports.Checked; if (Settings.Default.ReplaceDefaultHtmlReport) { RunReportHook.Install(); } else { RunReportHook.Uninstall(); } } Settings.Default.Save(); }