public TestStudioCompositeControl GetCompositeControl(bool useDockPanel)
        {
            ITestStudioContainer container = null;
            if (useDockPanel)
            {
                container = new TestStudioDockPanel();
                ((TestStudioDockPanel)container).DocumentStyle = WeifenLuo.WinFormsUI.Docking.DocumentStyle.DockingSdi;
            }

            var compositeControl = new TestStudioCompositeControl(container);
            if (useDockPanel)
                compositeControl.Dock = System.Windows.Forms.DockStyle.Fill;

            return compositeControl;
        }
        public void AddCompositeControlToForm(DockStyle dockStyle, TestStudioTab tabId = TestStudioTab.None)
        {
            // If we are not using a dockpanel then we need to set the
            // native Dock property.
            if (wrapChildren == false)
                (currentCompositeControl as Control).Dock = dockStyle;

            if (tabId == TestStudioTab.None)
            {
                AddChildToForm(currentCompositeControl, currentCompositeControl.Label, ConvertToDockState(dockStyle));

            }
            else
            {
                (currentCompositeControl as Control).Dock = DockStyle.Fill;
                AddChildToTab(tabId, currentCompositeControl, currentCompositeControl.Label, ConvertToDockState(dockStyle));
            }

            currentCompositeControl.AddEventHandler("HandleDestroyed", new EventHandler(TestStudioFormBuilder_HandleDestroyed));
            controls.Add(currentCompositeControl.Label, currentCompositeControl);

            currentCompositeControl = null;
        }
        public void AddControl(TestStudioControlType type, string label, DockStyle dockStyle, ITestStudioContainer compositeControl)
        {
            currentCompositeControl = compositeControl as TestStudioCompositeControl;
            if (currentCompositeControl == null)
                return;

            AddControl(type, label, dockStyle);

            currentCompositeControl = null;
        }
 public void Reset()
 {
     lastControlAdded = null;
     currentCompositeControl = null;
     foreach (var tab in tabs)
         ((Control)tab.Value).Dispose();
     tabs = new Dictionary<TestStudioTab, TestStudioCompositeControl>();
     controls = new Dictionary<string, ITestStudioControl>();
 }
 public void BeginCompositeControl(string label, bool wrapChildren = false)
 {
     this.wrapChildren = wrapChildren;
     currentCompositeControl = factory.GetCompositeControl(wrapChildren);
     currentCompositeControl.Label = label;
 }