Пример #1
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            ViewableTreeNode selected = nodeList.SelectedItem as ViewableTreeNode;
            string           word     = wordBox.Text;

            if (selected == null)
            {
                MessageBox.Show("You must select a parent before adding a word");
            }
            else if (string.IsNullOrEmpty(word))
            {
                MessageBox.Show("You must enter a word to add to the tree");
            }
            else
            {
                tree.Add(selected, word);
                wordBox.Text = "";
            }
        }