Esempio n. 1
0
        /// <summary>
        /// Edit the selected plug-in's project configuration
        /// </summary>
        /// <param name="sender">The sender of the event</param>
        /// <param name="e">The event arguments</param>
        private void btnConfigure_Click(object sender, EventArgs e)
        {
            PlugInConfiguration plugInConfig;
            string newConfig, currentConfig,
                   key = (string)lbProjectPlugIns.SelectedItem;

            if (PlugInManager.IsSupported(key))
            {
                PlugInInfo info = PlugInManager.PlugIns[key];

                using (IPlugIn plugIn = info.NewInstance())
                {
                    plugInConfig  = currentConfigs[key];
                    currentConfig = plugInConfig.Configuration;
                    newConfig     = plugIn.ConfigurePlugIn(currentConfigs.ProjectFile,
                                                           currentConfig);
                }

                // Only store it if new or if it changed
                if (currentConfig != newConfig)
                {
                    plugInConfig.Configuration = newConfig;
                }
            }
            else
            {
                MessageBox.Show("The selected plug-in either does not exist " +
                                "or is of a version that is not compatible with this " +
                                "version of the help file builder and cannot be used.",
                                Constants.AppName, MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }