Example #1
0
        /// <summary>
        /// The custom p lugin_ new_ click.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        /// <remarks></remarks>
        private void customPLugin_New_Click(object sender, EventArgs e)
        {
            string name = GetNameDialog.Show(
                "Choose new plugin name", "Input a name for the new plugin:", string.Empty, "&Set Name");
            if (name == null || name == string.Empty)
            {
                return;
            }

            if (!this.comboBox1.Items.Contains(name))
            {
                Prefs.CustomPluginMask mask = new Prefs.CustomPluginMask();
                mask.Name = name;
                Prefs.CustomPluginMasks.Add(mask);

                this.comboBox1.SelectedItem = comboBox1.Items[this.comboBox1.Items.Add(name)];
            }

            CustomPluginEditor cpe = new CustomPluginEditor(map);
            cpe.Owner = this;
            cpe.ShowDialog();
        }
Example #2
0
        /// <summary>
        /// The custom p lugin edit_ click.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        /// <remarks></remarks>
        private void customPLuginEdit_Click(object sender, EventArgs e)
        {
            if (comboBox1.SelectedItem == comboBox1.Items[0])
            {
                MessageBox.Show("The Complete Plugin Set cannot be edited.");
                return;
            }

            CustomPluginEditor cpe = new CustomPluginEditor(map);
            cpe.Owner = this;
            cpe.ShowDialog();
            string tempS = (string)cpe.comboBoxPluginName.SelectedItem;
            cpe.Dispose();

            // Remove all but the Complete Listing
            while (comboBox1.Items.Count > 1)
            {
                comboBox1.Items.RemoveAt(1);
            }

            foreach (Prefs.CustomPluginMask pluginMask in Prefs.CustomPluginMasks)
            {
                comboBox1.Items.Add(pluginMask.Name);
            }

            comboBox1.SelectedItem = tempS;
        }