Globals.PluginSetSelector.btnAddUpdate_Click C# (CSharp) Method

btnAddUpdate_Click() private method

private btnAddUpdate_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void btnAddUpdate_Click(object sender, EventArgs e)
        {
            // If [New] selected
            if (listBox1.SelectedIndex == listBox1.Items.Count - 1)
            {
                pluginInfo.Names.Add(tbPluginName.Text);
                pluginInfo.Paths.Add(tbPluginDirectory.Text);
                listBox1.Items.Insert(listBox1.Items.Count - 1, tbPluginName.Text);
                listBox1.SelectedIndex--;
            }
            else
            {
                pluginInfo.Names[listBox1.SelectedIndex] = tbPluginName.Text;
                pluginInfo.Paths[listBox1.SelectedIndex] = tbPluginDirectory.Text;
                listBox1.Items[listBox1.SelectedIndex] = tbPluginName.Text;
            }
        }