Ejemplo n.º 1
0
 public MultiTireDataViewer(EnumScreenCount Num, bool propertyEnable, bool screenCountEnable)
     : this()
 {
     PropertyEnable    = propertyEnable;
     ScreenCountEnable = screenCountEnable;
     ResetScreen(Num);
 }
Ejemplo n.º 2
0
        public void ResetScreen(EnumScreenCount Num)
        {
            if (Num == ScreenCount)
            {
                return;
            }
            foreach (var viewer in Viewers)
            {
                viewer.Parent = null;
            }
            this.Controls.Clear();
            if (Num == EnumScreenCount.One)
            {
                this.Controls.Add(Viewers[0]);
            }
            else if (Num == EnumScreenCount.Two_Hor)
            {
                var spritter1 = new SplitContainer();

                spritter1.Dock = DockStyle.Fill;
                spritter1.Panel1.Controls.Add(Viewers[0]);
                spritter1.Panel2.Controls.Add(Viewers[1]);
                this.Controls.Add(spritter1);
                spritter1.SplitterDistance = spritter1.Size.Width / 2;
            }
            else if (Num == EnumScreenCount.Two_Ver)
            {
                var spritter1 = new SplitContainer();
                spritter1.Dock = DockStyle.Fill;

                spritter1.Dock        = DockStyle.Fill;
                spritter1.Orientation = Orientation.Horizontal;
                spritter1.Panel1.Controls.Add(Viewers[0]);
                spritter1.Panel2.Controls.Add(Viewers[1]);
                this.Controls.Add(spritter1);
                spritter1.SplitterDistance = spritter1.Size.Height / 2;
            }
            else if (Num == EnumScreenCount.Four)
            {
                var spritter1 = new SplitContainer();
                var spritter2 = new SplitContainer();
                var spritter3 = new SplitContainer();
                spritter1.Dock        = DockStyle.Fill;
                spritter2.Dock        = DockStyle.Fill;
                spritter3.Dock        = DockStyle.Fill;
                spritter2.Orientation = Orientation.Horizontal;
                spritter3.Orientation = Orientation.Horizontal;



                spritter1.Panel1.Controls.Add(spritter2);
                spritter1.Panel2.Controls.Add(spritter3);


                spritter2.Panel1.Controls.Add(Viewers[0]);
                spritter2.Panel2.Controls.Add(Viewers[1]);
                spritter3.Panel1.Controls.Add(Viewers[2]);
                spritter3.Panel2.Controls.Add(Viewers[3]);

                this.Controls.Add(spritter1);
                spritter1.SplitterDistance = spritter1.Size.Width / 2;
                spritter2.SplitterDistance = spritter1.Size.Height / 2;
                spritter3.SplitterDistance = spritter1.Size.Height / 2;
            }
            else if (Num == EnumScreenCount.Six)
            {
                var spritter1 = new SplitContainer();
                var spritter2 = new SplitContainer();
                var spritter3 = new SplitContainer();
                var spritter4 = new SplitContainer();
                var spritter5 = new SplitContainer();
                spritter1.Dock = DockStyle.Fill;
                spritter2.Dock = DockStyle.Fill;
                spritter3.Dock = DockStyle.Fill;
                spritter4.Dock = DockStyle.Fill;
                spritter5.Dock = DockStyle.Fill;

                spritter3.Orientation = Orientation.Horizontal;
                spritter4.Orientation = Orientation.Horizontal;
                spritter5.Orientation = Orientation.Horizontal;

                spritter1.Panel2.Controls.Add(spritter2);

                spritter1.Panel1.Controls.Add(spritter3);
                spritter2.Panel1.Controls.Add(spritter4);
                spritter2.Panel2.Controls.Add(spritter5);

                spritter3.Panel1.Controls.Add(Viewers[0]);
                spritter3.Panel2.Controls.Add(Viewers[1]);
                spritter4.Panel1.Controls.Add(Viewers[2]);
                spritter4.Panel2.Controls.Add(Viewers[3]);
                spritter5.Panel1.Controls.Add(Viewers[4]);
                spritter5.Panel2.Controls.Add(Viewers[5]);

                this.Controls.Add(spritter1);
                spritter1.SplitterDistance = spritter1.Size.Width / 3;
                spritter2.SplitterDistance = spritter1.Size.Width / 3;

                spritter3.SplitterDistance = spritter1.Size.Height / 2;
                spritter4.SplitterDistance = spritter1.Size.Height / 2;
                spritter5.SplitterDistance = spritter1.Size.Height / 2;
            }
            else if (Num == EnumScreenCount.Nine)
            {
                var spritter1 = new SplitContainer();
                var spritter2 = new SplitContainer();
                var spritter3 = new SplitContainer();
                var spritter4 = new SplitContainer();
                var spritter5 = new SplitContainer();
                var spritter6 = new SplitContainer();
                var spritter7 = new SplitContainer();
                var spritter8 = new SplitContainer();
                spritter1.Dock = DockStyle.Fill;
                spritter2.Dock = DockStyle.Fill;
                spritter3.Dock = DockStyle.Fill;
                spritter4.Dock = DockStyle.Fill;
                spritter5.Dock = DockStyle.Fill;
                spritter6.Dock = DockStyle.Fill;
                spritter7.Dock = DockStyle.Fill;
                spritter8.Dock = DockStyle.Fill;


                spritter3.Orientation = Orientation.Horizontal;
                spritter4.Orientation = Orientation.Horizontal;
                spritter5.Orientation = Orientation.Horizontal;
                spritter6.Orientation = Orientation.Horizontal;
                spritter7.Orientation = Orientation.Horizontal;
                spritter8.Orientation = Orientation.Horizontal;

                spritter1.Panel2.Controls.Add(spritter2);

                spritter1.Panel1.Controls.Add(spritter3);
                spritter2.Panel1.Controls.Add(spritter4);
                spritter2.Panel2.Controls.Add(spritter5);

                spritter3.Panel2.Controls.Add(spritter6);
                spritter4.Panel2.Controls.Add(spritter7);
                spritter5.Panel2.Controls.Add(spritter8);


                spritter3.Panel1.Controls.Add(Viewers[0]);
                spritter4.Panel1.Controls.Add(Viewers[1]);
                spritter5.Panel1.Controls.Add(Viewers[2]);

                spritter6.Panel1.Controls.Add(Viewers[3]);
                spritter6.Panel2.Controls.Add(Viewers[4]);
                spritter7.Panel1.Controls.Add(Viewers[5]);
                spritter7.Panel2.Controls.Add(Viewers[6]);
                spritter8.Panel1.Controls.Add(Viewers[7]);
                spritter8.Panel2.Controls.Add(Viewers[8]);

                this.Controls.Add(spritter1);
                spritter1.SplitterDistance = spritter1.Size.Width / 3;
                spritter2.SplitterDistance = spritter1.Size.Width / 3;

                spritter3.SplitterDistance = spritter1.Size.Height / 3;
                spritter4.SplitterDistance = spritter1.Size.Height / 3;
                spritter5.SplitterDistance = spritter1.Size.Height / 3;
                spritter6.SplitterDistance = spritter1.Size.Height / 3;
                spritter7.SplitterDistance = spritter1.Size.Height / 3;
                spritter8.SplitterDistance = spritter1.Size.Height / 3;
            }
            OnResetScreen(Num);
            ScreenCount = Num;
        }