Exemple #1
0
        /// <summary>
        /// This function is called when the user clicks the menu item that shows the
        /// tool window. See the Initialize method to see how the menu item is associated to
        /// this function using the OleMenuCommandService service and the MenuCommand class.
        /// </summary>
        private void ShowCompareFilesConfigurationWindow(object sender, EventArgs e)
        {
            CompareToolConfiguration.LoadCompareToolConfiguration();

            using (var dialog = new ConfigurationDialog())
            {
                DialogResult result = dialog.ShowDialog();

                if (result == DialogResult.OK)
                {
                    CompareToolConfiguration.StoreCompareToolConfiguration(dialog.Configuration);
                }
            }
        }
        /// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        private void Execute(object sender, EventArgs e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            ConfigurationDialog.ShowCompareFilesConfigurationWindow(sender, e);
        }