Beispiel #1
0
 public override void DoTabs(TabControl tabControl, bool first, int offsetLeft, int offsetRight, int offsetTop, int offsetBottom, float scaleRatio, IPlugInMaster master, PlugInStandardCollection classPlugIns)
 {
     classPlugIns.Add(this);
     base.Master               = master;
     base.TabControl           = tabControl;
     base.TabPage              = new TabPage();
     base.TabPage.Text         = base.TabName;
     base.TabPage.SizeChanged += this.TabPage_SizeChanged;
     base.TabControl.Controls.Add(base.TabPage);
     this.m_Navigator    = new CollectionNavigatorPanel();
     this.Navigator.Dock = DockStyle.Left;
     this.Navigator.SelectedIndexChanged += this.Navigator_SelectedIndexChanged;
     this.Navigator.ItemMoved            += this.Navigator_ItemMoved;
     this.Navigator.ItemAdd    += this.Navigator_ItemAdd;
     this.Navigator.ItemRemove += this.Navigator_ItemRemove;
     this.Navigator.Types       = this.Types;
     this.Navigator.DoLayout();
     base.Master.UpdateExtents(this.Navigator.Width + offsetLeft + offsetRight, this.Navigator.Height + offsetTop + offsetBottom);
     base.TabPage.Controls.Add(this.Navigator);
     this.Navigator.DoLayout();
     base.TabPage.Resize    += this.TabPage_Resize;
     offsetLeft             += base.Master.TabPageBorderSize + this.Navigator.Width;
     offsetRight            += base.Master.TabPageBorderSize;
     offsetTop              += base.Master.TabPageBorderSize + base.Master.TabHeight;
     offsetBottom           += base.Master.TabPageBorderSize;
     this.m_PlugInPool       = this.CreatePlugInPool();
     this.m_ClassTabControls = new TabControl[this.m_PlugInPool.Length];
     for (int i = 0; i < this.m_PlugInPool.Length; i++)
     {
         this.m_ClassTabControls[i]        = new TabControl();
         this.m_ClassTabControls[i].Left   = this.Navigator.Right;
         this.m_ClassTabControls[i].Width  = 700;
         this.m_ClassTabControls[i].Height = 400;
         base.TabPage.Controls.Add(this.m_ClassTabControls[i]);
     }
     for (int j = 0; j < this.m_PlugInPool.Length; j++)
     {
         PlugInStandard plugInStandard = this.m_PlugInPool[j];
         plugInStandard.TabName = "General";
         plugInStandard.DoTabs(this.m_ClassTabControls[j], true, offsetLeft, offsetRight, offsetTop, offsetBottom, scaleRatio, master, plugInStandard.ClassPlugIns);
     }
     for (int k = 0; k < this.m_ClassTabControls.Length; k++)
     {
         this.m_ClassTabControls[k].Visible = false;
     }
 }
Beispiel #2
0
        public virtual void DoTabs(TabControl tabControl, bool first, int offsetLeft, int offsetRight, int offsetTop, int offsetBottom, float scaleRatio, IPlugInMaster master, PlugInStandardCollection classPlugIns)
        {
            this.m_Master = master;
            this.PopulateAllControls(base.Controls);
            if (!(this is AboutPlugIn))
            {
                classPlugIns.Add(this);
                this.ConnectEditorControls();
            }
            base.Scale(new SizeF(scaleRatio, scaleRatio));
            this.FixupSize(0, 0);
            this.CreateSubPlugIns();
            bool flag = false;
            int  num  = 0;

            while (num < this.SubPlugIns.Count)
            {
                if (!this.SubPlugIns[num].SameLevel)
                {
                    num++;
                    continue;
                }
                flag = true;
                break;
            }
            if (flag)
            {
                this.TabPage      = new TabPage();
                this.TabPage.Text = this.TabName;
                tabControl.Controls.Add(this.TabPage);
                this.TabControl      = new TabControl();
                this.TabControl.Dock = DockStyle.Fill;
                this.TabPage.Controls.Add(this.TabControl);
                int offsetLeft2   = offsetLeft;
                int offsetRight2  = offsetRight;
                int offsetTop2    = offsetTop;
                int offsetBottom2 = offsetBottom;
                offsetLeft   += this.Master.TabPageBorderSize;
                offsetRight  += this.Master.TabPageBorderSize;
                offsetTop    += this.Master.TabPageBorderSize + this.Master.TabHeight;
                offsetBottom += this.Master.TabPageBorderSize;
                this.TabName  = "General";
                this.CreatePlugInTab(offsetLeft, offsetRight, offsetTop, offsetBottom);
                for (int i = 0; i < this.SubPlugIns.Count; i++)
                {
                    if (this.SubPlugIns[i].SameLevel)
                    {
                        this.SubPlugIns[i].DoTabs(this.TabControl, false, offsetLeft, offsetRight, offsetTop, offsetBottom, scaleRatio, master, classPlugIns);
                    }
                }
                for (int j = 0; j < this.SubPlugIns.Count; j++)
                {
                    if (!this.SubPlugIns[j].SameLevel)
                    {
                        this.SubPlugIns[j].DoTabs(tabControl, false, offsetLeft2, offsetRight2, offsetTop2, offsetBottom2, scaleRatio, master, classPlugIns);
                    }
                }
            }
            else if (!first && this.SubPlugIns.Count != 0)
            {
                this.TabPage      = new TabPage();
                this.TabPage.Text = this.TabName;
                tabControl.Controls.Add(this.TabPage);
                this.TabControl      = new TabControl();
                this.TabControl.Dock = DockStyle.Fill;
                this.TabPage.Controls.Add(this.TabControl);
                offsetLeft   += this.Master.TabPageBorderSize;
                offsetRight  += this.Master.TabPageBorderSize;
                offsetTop    += this.Master.TabPageBorderSize + this.Master.TabHeight;
                offsetBottom += this.Master.TabPageBorderSize;
                this.TabName  = "General";
                this.CreatePlugInTab(offsetLeft, offsetRight, offsetTop, offsetBottom);
                for (int k = 0; k < this.SubPlugIns.Count; k++)
                {
                    this.SubPlugIns[k].DoTabs(this.TabControl, false, offsetLeft, offsetRight, offsetTop, offsetBottom, scaleRatio, master, classPlugIns);
                }
            }
            else
            {
                this.TabControl = tabControl;
                this.CreatePlugInTab(offsetLeft, offsetRight, offsetTop, offsetBottom);
                for (int l = 0; l < this.SubPlugIns.Count; l++)
                {
                    this.SubPlugIns[l].DoTabs(tabControl, false, offsetLeft, offsetRight, offsetTop, offsetBottom, scaleRatio, master, classPlugIns);
                }
            }
        }