Esempio n. 1
0
        private bool close(MarkdownEditor meditor)
        {
            if (meditor.AlreadyUpdate)
            {
                DialogResult dr = MessageBox.Show("修改还没有保存,需要保存吗?", "提示", MessageBoxButtons.YesNoCancel);
                if (dr == DialogResult.Cancel)
                {
                    return(false);
                }

                if (dr == DialogResult.Yes)
                {
                    if (!save(meditor))
                    {
                        return(false);
                    }
                }
            }

            int ind = TabSelectRec.GetLast();

            if (ind > -1 && ind < _tabparent.TabCount)
            {
                _tabparent.SelectedIndex = ind;
            }

            _editors.Remove((int)meditor.MarkdownPage.Tag);
            _tabparent.TabPages.Remove(meditor.MarkdownPage);

            return(true);
        }
Esempio n. 2
0
 private void tabControl1_Selected(object sender, TabControlEventArgs e)
 {
     TabSelectRec.Rec(e.TabPageIndex);
     PreviewHtml();
 }