Esempio n. 1
0
        private void EditSignature()
        {
            ListView.SelectedListViewItemCollection selections = settingsSignaturesList.SelectedItems;
            if (selections.Count == 1)
            {
                ListViewItem lvItem = selections[0];
                string signatureBeingEdited = lvItem.Text;

                SignatureEditor editor = new SignatureEditor(signatureBeingEdited);
                if (editor.ShowDialog() == DialogResult.OK)
                {
                    if (editor.SignatureTitle != signatureBeingEdited)
                    {
                        Signatures.DefaultSignatures.RemoveSignature(signatureBeingEdited);
                    }
                    Signatures.DefaultSignatures.AddSignature(editor.SignatureTitle, editor.SignatureText);
                    LoadSignaturesList();

                    lvItem = settingsSignaturesList.FindItemWithText(editor.SignatureTitle);
                    if (lvItem != null)
                    {
                        lvItem.Selected = true;
                        settingsSignaturesList.Select();
                    }
                }
            }
        }
Esempio n. 2
0
        private void EditSignature()
        {
            ListView.SelectedListViewItemCollection selections = settingsSignaturesList.SelectedItems;
            if (selections.Count == 1)
            {
                ListViewItem lvItem = selections[0];
                string       signatureBeingEdited = lvItem.Text;

                SignatureEditor editor = new SignatureEditor(signatureBeingEdited);
                if (editor.ShowDialog() == DialogResult.OK)
                {
                    if (editor.SignatureTitle != signatureBeingEdited)
                    {
                        Signatures.DefaultSignatures.RemoveSignature(signatureBeingEdited);
                    }
                    Signatures.DefaultSignatures.AddSignature(editor.SignatureTitle, editor.SignatureText);
                    LoadSignaturesList();

                    lvItem = settingsSignaturesList.FindItemWithText(editor.SignatureTitle);
                    if (lvItem != null)
                    {
                        lvItem.Selected = true;
                        settingsSignaturesList.Select();
                    }
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Create a new signature.
        /// </summary>
        private void settingsNewSignature_Click(object sender, EventArgs e)
        {
            SignatureEditor editor = new SignatureEditor("");

            if (editor.ShowDialog() == DialogResult.OK)
            {
                Signatures.DefaultSignatures.AddSignature(editor.SignatureTitle, editor.SignatureText);
                LoadSignaturesList();

                ListViewItem lvItem = settingsSignaturesList.FindItemWithText(editor.SignatureTitle);
                if (lvItem != null)
                {
                    lvItem.Selected = true;
                    settingsSignaturesList.Select();
                }

                UpdateSignatureButtons();
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Create a new signature.
        /// </summary>
        private void settingsNewSignature_Click(object sender, EventArgs e)
        {
            SignatureEditor editor = new SignatureEditor("");
            if (editor.ShowDialog() == DialogResult.OK)
            {
                Signatures.DefaultSignatures.AddSignature(editor.SignatureTitle, editor.SignatureText);
                LoadSignaturesList();

                ListViewItem lvItem = settingsSignaturesList.FindItemWithText(editor.SignatureTitle);
                if (lvItem != null)
                {
                    lvItem.Selected = true;
                    settingsSignaturesList.Select();
                }

                UpdateSignatureButtons();
            }
        }