示例#1
0
        private void Button_Click2(object sender, RoutedEventArgs e)
        {
            string w = "";
            string s = "";
            string t = "";

            w = aWord.Text;
            s = aStatus.SelectedValue.ToString();
            t = aTranslation.Text;
            if (aWord.Text != "" && aStatus.SelectedValue.ToString() != "" && aTranslation.Text != "")
            {
                if (word.check(aWord.Text))
                {
                    MessageBox.Show("This word already exists !", "Attention", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                else
                {
                    word.writeWords(w, s, t);
                }
                aWord.Text        = "";
                aTranslation.Text = "";
            }

            word.initialize();
            SearchWord.ItemsSource = word.word;
        }