/// <summary>
        /// The button 3_ click.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        /// <remarks></remarks>
        private void dupBtn_Click(object sender, EventArgs e)
        {
            string name = GetNameDialog.Show(
                "Select duplicated plugin name",
                "Select name for the duplicated plugin:",
                comboBoxPluginName.Text,
                "&Duplicate");
            if (name != null)
            {
                Prefs.CustomPluginMask newMask = new Prefs.CustomPluginMask();
                newMask.Name = Prefs.CustomPluginMasks[comboBoxPluginName.SelectedIndex].Name;
                newMask.VisibleTagTypes.AddRange(Prefs.CustomPluginMasks[comboBoxPluginName.SelectedIndex].VisibleTagTypes);
                Prefs.CustomPluginMasks .Add(newMask);

                comboBoxPluginName.SelectedIndex = comboBoxPluginName.Items.Add(name);
            }
        }
Exemple #2
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();
        }