Ext.Net.BorderLayoutDesigner.BuildRegion C# (CSharp) Method

BuildRegion() private method

private BuildRegion ( BorderLayoutRegion region, System.Web.UI.WebControls.Unit width, System.Web.UI.WebControls.Unit height ) : Control
region BorderLayoutRegion
width System.Web.UI.WebControls.Unit
height System.Web.UI.WebControls.Unit
return System.Web.UI.Control
        private Control BuildRegion(BorderLayoutRegion region, Unit width, Unit height)
        {
            if (!this.SchemeMode && region.Items.Count > 0)
            {
                Component item = region.Items[0];

                if (ReflectionUtils.IsTypeOf(item, typeof(PanelBase), false))
                {
                    this.AddIcon(((PanelBase)item).Icon); 
                }
                
                
                PanelBaseDesigner designer;

                if (ReflectionUtils.IsTypeOf(item, typeof(Panel), false))
                {
                    designer = new PanelDesigner();
                }
                else if (ReflectionUtils.IsTypeOf(item, typeof(TabPanel), false))
                {
                    designer = new TabPanelDesigner();
                }
                else
                {
                    return BuildStub(region, height, width, true);
                }

                designer.Width = width;

                if (region == this.layout.North || region == this.layout.South)
                {
                    designer.Height = height;
                }
                designer.Layout = LayoutType.Border;
                designer.BorderRegion = region;

                designer.CurrentDesigner = this.CurrentDesigner;
                designer.Initialize(item);

                return new LiteralControl(designer.GetDesignTimeHtml(this.designerRegions));
            }
            else
            {
                return BuildStub(region, height, width, false);
            }
        }