BlueSky.Windows.ValueLablesDialog.valLblAddBut_Click C# (CSharp) Method

valLblAddBut_Click() private method

private valLblAddBut_Click ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
return void
        private void valLblAddBut_Click(object sender, RoutedEventArgs e)
        {
            string newl = labelTextbox.Text;
            if (newl.Length > 0)
            {
                //validations here. 1.No duplicates, 2.v could be numeric only
                //Checking duplicate value and lable
                if (isDuplicate(newl))
                {
                    MessageBox.Show("Duplicate entry!");
                }
                else
                {
                    //Adding to list if value is unique
                    ValLstBox.Items.Add(newl);
                    //ValuetextBox.Text = "";
                    vlmatrix.addLevel(newl, ValLstBox.Items.IndexOf(newl), false);//adding to matrix too
                    labelTextbox.Text = "";
                    modified = true; 
                }
            }
        }