void createNewProfile() { FormNewProfile formNewProfile = new FormNewProfile(); formNewProfile.ShowDialog(); string profileName = formNewProfile.profileName; if (profileName != "") { Profile p = new Profile(profileName); profileList.Add(p); comboBox2.DataSource = null; comboBox2.DataSource = profileList; comboBox2.SelectedItem = p; } }
void refreshProfile(Profile p) { if (p.commandList.Count != 0) { Choices myWordChoices = new Choices(); foreach (Command c in p.commandList) { string[] commandList = c.commandString.Split(';'); foreach (string s in commandList) { string correctedWord; correctedWord = s.Trim().ToLower(); if (correctedWord != null && correctedWord != "") { myWordChoices.Add(correctedWord); } } } GrammarBuilder builder = new GrammarBuilder(); builder.Append(myWordChoices); Grammar mygram = new Grammar(builder); speechEngine.UnloadAllGrammars(); speechEngine.LoadGrammar(mygram); } else { speechEngine.UnloadAllGrammars(); } }
private void createNewProfile() { FormNewProfile formNewProfile = new FormNewProfile(); formNewProfile.ShowDialog(); string profileName = formNewProfile.profileName; if (profileName != "") { Profile p = new Profile(profileName); _ProfileList.Add(p); ComboProfiles.DataSource = null; ComboProfiles.DataSource = _ProfileList; ComboProfiles.SelectedItem = p; } }