AutoWikiBrowser.Plugins.Kingbotk.PluginManager.AddGenericTemplateMenuItem_Click C# (CSharp) Method

AddGenericTemplateMenuItem_Click() private static method

private static AddGenericTemplateMenuItem_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private static void AddGenericTemplateMenuItem_Click(object sender, EventArgs e)
        {
            var res = WikiFunctions.Controls.InputBox.Show("Enter the name for this generic plugin", "Enter name", "", null);
            if (res.OK && !string.IsNullOrEmpty(res.Text))
            {
                string str = res.Text.Trim();
                if (Plugins.ContainsKey(str))
                {
                    MessageBox.Show("A plugin of this name already exists", "Error", MessageBoxButtons.OK,
                        MessageBoxIcon.Exclamation);
                    return;
                }

                if (str.Contains(" "))
                {
                    str = str.Replace(" ", "");
                }

                CreateNewGenericPlugin(str);
            }
        }