Beispiel #1
0
        protected override void LayoutExample()
        {
            NExampleBaseUC uc = CurrentExampleControl as NExampleBaseUC;

            if (uc == null)
            {
                return;
            }

            int nWidth  = uc.Width + 10;
            int nHeight = uc.Height + 60;

            ExampleLayout newLayout = (nWidth > 330) ? ExampleLayout.WideScreen : ExampleLayout.Standard;

            if (m_CurrentLayout == newLayout)
            {
                if (ExamplePanel.ParentZone != null)
                {
                    if (newLayout == ExampleLayout.WideScreen)
                    {
                        ExamplePanel.SizeInfo.AbsoluteSize = new Size(0, nHeight);
                    }
                    else if (newLayout == ExampleLayout.Standard)
                    {
                        ExamplePanel.SizeInfo.AbsoluteSize = new Size(nWidth, 0);
                    }
                }
            }
            else
            {
                m_CurrentLayout = newLayout;

                NDockingPanelContainer mainContainer = DockManager.MainContainer;

                if (newLayout == ExampleLayout.WideScreen)
                {
                    INDockZone        zone   = DockManager.m_ControlHost.ParentZone;
                    NDockingPanelHost dpHost = FindDockingPanelHostInZone(zone);

                    if (dpHost != null)
                    {
                        ExamplePanel.PerformDock(dpHost, DockStyle.Fill, 0);
                    }
                    else
                    {
                        ExamplePanel.PerformDock(zone, DockStyle.Bottom, 0);
                    }

                    ExamplePanel.SizeInfo.AbsoluteSize = new Size(0, nHeight);
                }
                else if (newLayout == ExampleLayout.Standard)
                {
                    ExamplePanel.PerformDock(mainContainer.RootZone, DockStyle.Right, 0);
                    ExamplePanel.SizeInfo.AbsoluteSize = new Size(nWidth, 0);
                }
            }
        }
Beispiel #2
0
 public void ShowPanel()
 {
     ExamplePanel.Open();
 }