Exemplo n.º 1
0
        private void toolStripButtonDeleteGradient_Click(object sender, EventArgs e)
        {
            if (listViewGradients.SelectedItems.Count == 0)
            {
                return;
            }

            //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
            MessageBoxForm.msgIcon = SystemIcons.Warning;             //this is used if you want to add a system icon to the message form.
            var messageBox = new MessageBoxForm("If you delete the selected library gradient(s), ALL places it is used will be unlinked and will" +
                                                @" become independent gradients. Are you sure you want to continue?", "Delete library gradient?", true, true);

            messageBox.ShowDialog();

            if (messageBox.DialogResult == DialogResult.OK)
            {
                _colorGradientLibrary.BeginBulkUpdate();
                foreach (ListViewItem item in listViewGradients.SelectedItems)
                {
                    _colorGradientLibrary.RemoveColorGradient(item.Name);
                }
                _colorGradientLibrary.EndBulkUpdate();
                OnGradientLibraryChanged();
            }
        }
Exemplo n.º 2
0
        private void toolStripButtonDeleteGradient_Click(object sender, EventArgs e)
        {
            if (listViewGradients.SelectedItems.Count == 0)
            {
                return;
            }

            DialogResult result =
                MessageBox.Show("If you delete this library gradient, ALL places it is used will be unlinked and will" +
                                " become independent gradients. Are you sure you want to continue?", "Delete library gradient?",
                                MessageBoxButtons.YesNoCancel);

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                _colorGradientLibrary.RemoveColorGradient(listViewGradients.SelectedItems[0].Name);
            }
        }