コード例 #1
0
        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();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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();
        }