Exemplo n.º 1
0
        public void AddNewPage(TabPageEx tabPageEx_0)
        {
            base.TabPages.Add(tabPageEx_0);
            IEnumerator enumerator = base.TabPages.GetEnumerator();
            {
                TabPage current;
                while (enumerator.MoveNext())
                {
                    current = (TabPage)enumerator.Current;
                    if ((current.Name == tabPageEx_0.Name) && (current.Text == tabPageEx_0.Text))
                    {
                        goto Label_0057;
                    }
                }
                return;

Label_0057:
                ((TabPageEx)current).FormClose += new FormClosedEventHandler(this.method_7);
            }
        }
Exemplo n.º 2
0
        public void Show(Control control_0)
        {
            if (_showStyle != FormStyle.New)
            {
                this._owner = null;
                Form form2 = control_0 as Form;
                this._parent = form2;
                if (form2 != null)
                {
                    Form[] formArray4 = form2.MdiChildren;
                    if (formArray4 != null)
                    {
                        foreach (Form form3 in formArray4)
                        {
                            if (form3 is DockForm)
                            {
                                form3.Close();
                            }
                        }
                    }
                }
                Form[] mdiChildren = form2.MdiChildren;
                bool   flag        = true;
                if (mdiChildren != null)
                {
                    foreach (Form form in mdiChildren)
                    {
                        if (form is DockForm)
                        {
                            flag = false;
                            break;
                        }
                    }
                }
                if (flag)
                {
                    base.MdiParent = form2;
                    base.CenterToParent();
                    base.MinimizeBox = false;
                    base.WindowState = FormWindowState.Maximized;
                    if (form2 is DockForm)
                    {
                        ((DockForm)form2).vmethod_0("  关闭  ");
                    }
                    base.FormClosed += new FormClosedEventHandler(this.DockForm_FormClosed);
                    base.Show();
                }
                return;
            }
            this._parent = null;
            this._owner  = control_0 as TabControlEx;
            TabPage     page       = null;
            IEnumerator enumerator = this._owner.TabPages.GetEnumerator();

            {
                TabPage current;
                while (enumerator.MoveNext())
                {
                    current = (TabPage)enumerator.Current;
                    if ((current.Name == base.Name) && (current.Text == this.Text))
                    {
                        goto Label_0073;
                    }
                }
                goto Label_008C;
Label_0073:
                page = current;
            }
Label_008C:
            if (page == null)
            {
                this.Text = this.Text.Trim() + "    ";
                TabPageEx ex = new TabPageEx {
                    Name = base.Name,
                    Text = this.Text
                };
                this._owner.AddNewPage(ex);
                this._owner.SelectedIndex = this._owner.TabCount - 1;
                base.TopLevel             = false;
                base.FormBorderStyle      = FormBorderStyle.None;
                ex.AddForm(this);
                this.Dock = DockStyle.Fill;
                base.Show();
            }
            else
            {
                this._owner.SelectedTab = page;
            }
        }