private void Search_Button_Click(object sender, RoutedEventArgs e)
        {
            var word = Search_TextBox.Text;

            word = Regex.Replace(word, "[.,']", "", RegexOptions.IgnoreCase).ToLower();
            var helper = new WordHelper();

            word = helper.getVerbRoot(word);
            word = helper.getSingularNoun(word);
            var gridBuilder = new DictionarySwitchTabGrid();

            gridBuilder.SetDictionarySwitchTabControl(word, SearchGrid);
        }
示例#2
0
        public wordExplanationWindow(string wordStr)
        {
            InitializeComponent();
            WordHelper helper = new WordHelper();

            //去除'和.和,
            wordStr = Regex.Replace(wordStr, "[.,']", "", RegexOptions.IgnoreCase);
            wordStr = wordStr.ToLower();
            //獲得原型動詞與單數
            wordStr      = helper.getVerbRoot(wordStr);
            wordStr      = helper.getSingularNoun(wordStr);
            this.wordStr = wordStr;

            var dictionarySwitchTabGrid = new DictionarySwitchTabGrid();

            shown = dictionarySwitchTabGrid.SetDictionarySwitchTabControl(wordStr, mainGrid);
        }
 private void Local_WordListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (Local_WordListBox.SelectedValue != null)
     {
         checkWordRemark(Local_OldWord);
         string word = Local_WordListBox.SelectedValue.ToString();
         Local_OldWord = word;
         var gridBuilder = new DictionarySwitchTabGrid();
         gridBuilder.SetDictionarySwitchTabControl(word, Local_WordGrid);
         //remarkTB.Text = Words[word].remark;
         //remarkTB.IsEnabled = true;
     }
     else
     {
         Local_OldWord = string.Empty;
         Local_WordGrid.Children.Clear();
         //remarkTB.Text = "";
         //remarkTB.IsEnabled = false;
     }
 }