Exemple #1
0
        private void toolStripButtonDeleteCurve_Click(object sender, EventArgs e)
        {
            if (listViewCurves.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 curve(s), ALL places it is used will be unlinked and will" +
                                                @" become independent curves. Are you sure you want to continue?", "Delete library curve?", true, true);

            messageBox.ShowDialog();

            if (messageBox.DialogResult == DialogResult.OK)
            {
                _curveLibrary.BeginBulkUpdate();
                foreach (ListViewItem item in listViewCurves.SelectedItems)
                {
                    _curveLibrary.RemoveCurve(item.Name);
                }
                _curveLibrary.EndBulkUpdate();
                OnCurveLibraryChanged();
            }
        }
Exemple #2
0
        private void toolStripButtonDeleteCurve_Click(object sender, EventArgs e)
        {
            if (listViewCurves.SelectedItems.Count == 0)
            {
                return;
            }

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

            if (result == System.Windows.Forms.DialogResult.Yes)
            {
                _curveLibrary.RemoveCurve(listViewCurves.SelectedItems[0].Name);
            }
        }