Exemplo n.º 1
0
        private void toolStripLabelRemove_Click(object sender, EventArgs e)
        {
            if (tabControlExperts.SelectedIndex > -1)
            {
                ExpertInformation info = ((ExpertEditorControl)tabControlExperts.SelectedTab.Controls[0]).ExpertInformation;
                if (info.IsSavedLocally == false)
                {
                    DialogResult result = MessageBox.Show("Expert [" + info.Name + "] not saved. Save changes now?", "Warning", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
                    if (result == DialogResult.Yes)
                    {// Yes.
                        info.SaveLocal();
                    }
                    else if (result == DialogResult.No)
                    {// No, just continue.
                    }
                    else
                    {// Cancel operation.
                        return;
                    }
                }

                ExpertEditorControl control = (ExpertEditorControl)tabControlExperts.SelectedTab.Controls[0];
                control.ExpertUpdateEvent -= new ExpertEditorControl.ExpertUpdatedDelegate(editorControl_ExpertUpdateEvent);
                tabControlExperts.TabPages.Remove(tabControlExperts.SelectedTab);
            }
        }
Exemplo n.º 2
0
        private void toolStripButtonSave_Click(object sender, EventArgs e)
        {
            _expertInformation.SourceCode = syntaxDocument.Text;
            _expertInformation.SaveLocal();

            UpdateUI(false);
        }