private void Add_Word_Click(object sender, RoutedEventArgs e) { string s0 = TB_Add1.Text.Trim(), s1 = TB_Add2.Text.Trim(); if (s0.Length != 0 && s1.Length != 0) { var todb = new WordMap { Word = s0, Meaning = s1 }; words_.InsertSorted(todb, x => x.Word); // Show the first dialog. new PluginWordsRecord("English", todb.Id).ShowDialog(); new PluginWordsRecord("Russian", todb.Id).ShowDialog(); MP3Recorder.Mix( "./Clips/" + todb.Id.ToString() + "_English_Russian.mp3", "./Raw/" + todb.Id.ToString() + "_English.mp3", "./Raw/" + todb.Id.ToString() + "_Russian.mp3"); MP3Recorder.Mix( "./Clips/" + todb.Id.ToString() + "_Russian_English.mp3", "./Raw/" + todb.Id.ToString() + "_Russian.mp3", "./Raw/" + todb.Id.ToString() + "_English.mp3"); } TB_Add1.Text = ""; TB_Add2.Text = ""; TB_Add1.Focus(); }
public PluginWordsConfigure(SQLiteConnection db, ObservableCollection <WordMap> words) { db_ = db; words_ = words; InitializeComponent(); TB_Add1.Focus(); List_Words.ItemsSource = words; InputLanguageManager.SetInputLanguage(TB_Add2, CultureInfo.CreateSpecificCulture("en-GB")); InputLanguageManager.SetInputLanguage(TB_Add1, CultureInfo.CreateSpecificCulture("ru-RU")); }