Пример #1
0
        protected override void BuildScriptDescriptor(ScriptComponentDescriptor descriptor)
        {
            base.BuildScriptDescriptor(descriptor);
            DockElement dockElement = (this.Controls.Count > 0) ? (this.Controls[0] as DockElement) : null;

            if (dockElement != null)
            {
                descriptor.AddComponentProperty("ChildDockPanel", dockElement);
            }
        }
Пример #2
0
        private DockElement PutDockPanelInBuddyPanel(WebControl currentContainer, DockElement panel)
        {
            string key  = string.Empty;
            Unit   unit = Unit.Empty;
            HtmlTextWriterStyle key2 = HtmlTextWriterStyle.MarginLeft;
            int num = 2;

            switch (panel.Dock)
            {
            case DockStyle.Top:
                key  = "top";
                unit = panel.Height;
                key2 = HtmlTextWriterStyle.MarginTop;
                num += panel.BorderWidths.VerticalWidth;
                break;

            case DockStyle.Left:
                key  = (RtlUtil.IsRtl ? "right" : "left");
                unit = panel.Width;
                key2 = (RtlUtil.IsRtl ? HtmlTextWriterStyle.MarginRight : HtmlTextWriterStyle.MarginLeft);
                num += panel.BorderWidths.HorizontalWidth;
                break;

            case DockStyle.Right:
                key  = (RtlUtil.IsRtl ? "left" : "right");
                unit = panel.Width;
                key2 = (RtlUtil.IsRtl ? HtmlTextWriterStyle.MarginLeft : HtmlTextWriterStyle.MarginRight);
                num += panel.BorderWidths.HorizontalWidth;
                break;

            case DockStyle.Bottom:
                key  = "bottom";
                unit = panel.Height;
                key2 = HtmlTextWriterStyle.MarginBottom;
                num += panel.BorderWidths.VerticalWidth;
                break;
            }
            DockElement dockElement = new DockElement();

            currentContainer.Controls.Add(dockElement);
            panel.FillPanel = dockElement;
            dockElement.Style.Add(key, unit.ToString());
            dockElement.Style.Add(key2, num + "px");
            return(dockElement);
        }
Пример #3
0
        protected override void BuildScriptDescriptor(ScriptComponentDescriptor descriptor)
        {
            base.BuildScriptDescriptor(descriptor);
            DockElement dockElement = (this.Controls.Count > 0) ? (this.Controls[0] as DockElement) : null;

            if (dockElement != null)
            {
                descriptor.AddComponentProperty("ChildDockPanel", dockElement);
            }
            else if (this.FillPanel != null)
            {
                descriptor.AddComponentProperty("FillPanel", this.FillPanel);
            }
            if (this.Dock != DockStyle.Fill)
            {
                descriptor.AddProperty("Dock", this.Dock);
            }
            descriptor.AddProperty("AutoSize", this.AutoSize, true);
        }