Пример #1
0
        /// <summary>
        /// Handles the Click event of the buttonNew control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void buttonNew_Click(object sender, EventArgs e)
        {
            //  Create the edit accent dialog, with the 'New Accent' option.
            var newAccentForm = new FormEditAccent(FormEditAccent.EditMode.NewAccent);

            //  Show the dialog.
            if (newAccentForm.ShowDialog(this) == DialogResult.OK)
            {
                //  We have a new accent, add it to the settings and repopulate.
                ApplicationContext.Instance.Settings.Accents.Add(newAccentForm.Accent);
                ApplicationContext.Instance.SaveSettings();
                OnAccentsChanged();
            }
        }
Пример #2
0
        /// <summary>
        /// Handles the Click event of the buttonEdit control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            //  Get the selected accent.
            if (SelectedAccent != null)
            {
                //  Create the edit accent dialog, with the 'New Accent' option.
                var newAccentForm = new FormEditAccent(FormEditAccent.EditMode.EditAccent);
                newAccentForm.Accent = SelectedAccent;

                //  Show the dialog.
                if (newAccentForm.ShowDialog(this) == DialogResult.OK)
                {
                    //  We have changed an accent.
                    ApplicationContext.Instance.SaveSettings();
                    OnAccentsChanged();
                }
            }
        }
Пример #3
0
        /// <summary>
        /// Handles the Click event of the buttonEdit control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            //  Get the selected accent.
            if (SelectedAccent != null)
            {

                //  Create the edit accent dialog, with the 'New Accent' option.
                var newAccentForm = new FormEditAccent(FormEditAccent.EditMode.EditAccent);
                newAccentForm.Accent = SelectedAccent;

                //  Show the dialog.
                if (newAccentForm.ShowDialog(this) == DialogResult.OK)
                {
                    //  We have changed an accent.
                    ApplicationContext.Instance.SaveSettings();
                    OnAccentsChanged();
                }
            }
        }
Пример #4
0
        /// <summary>
        /// Handles the Click event of the buttonNew control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void buttonNew_Click(object sender, EventArgs e)
        {
            //  Create the edit accent dialog, with the 'New Accent' option.
            var newAccentForm = new FormEditAccent(FormEditAccent.EditMode.NewAccent);

            //  Show the dialog.
            if (newAccentForm.ShowDialog(this) == DialogResult.OK)
            {
                //  We have a new accent, add it to the settings and repopulate.
                ApplicationContext.Instance.Settings.Accents.Add(newAccentForm.Accent);
                ApplicationContext.Instance.SaveSettings();
                OnAccentsChanged();
            }
        }