void AEditServicesExecute(object sender, EventArgs e) { ListViewItem lvi = lvProfiles.SelectedItems[0]; UserTranslateProfile pf = lvi.Tag as UserTranslateProfile; CustomProfileServicesForm form = new CustomProfileServicesForm(pf); if (form.ShowDialog(this) == DialogResult.OK) { lvServices.Services = (pf as UserTranslateProfile).Services; pf.History.Clear(); } form.Dispose(); }
void AEditProfileServicesExecute(object sender, EventArgs e) { UserTranslateProfile pf = currentProfile as UserTranslateProfile; if(pf == null) return; CustomProfileServicesForm form = new CustomProfileServicesForm(pf); if(form.ShowDialog(this) == DialogResult.OK) { pf.Subjects.Clear(); pf.Subjects.AddRange(pf.GetSupportedSubjects()); pf.History.Clear(); languageSelector.Profile = currentProfile; } form.Dispose(); }
void AAddProfileExecute(object sender, EventArgs e) { UserTranslateProfile pf = new UserTranslateProfile(); SetProfileNameForm nameForm = new SetProfileNameForm(pf, TranslateOptions.Instance.Profiles); DialogResult dr = nameForm.ShowDialog(FindForm()); nameForm.Dispose(); if(dr == DialogResult.Cancel) return; CustomProfileServicesForm form = new CustomProfileServicesForm(pf); form.ShowDialog(this); form.Dispose(); TranslateOptions.Instance.Profiles.Add(pf); TranslateOptions.Instance.CurrentProfile = pf; pf.Subjects.AddRange(pf.GetSupportedSubjects()); UpdateProfiles(); }
void AEditServicesExecute(object sender, EventArgs e) { ListViewItem lvi = lvProfiles.SelectedItems[0]; UserTranslateProfile pf = lvi.Tag as UserTranslateProfile; CustomProfileServicesForm form = new CustomProfileServicesForm(pf); if(form.ShowDialog(this) == DialogResult.OK) { lvServices.Services = (pf as UserTranslateProfile).Services; pf.History.Clear(); } form.Dispose(); }