Esempio n. 1
0
 /// <summary>
 /// Inits the sizes.
 /// </summary>
 /// <param name="Control">The control.</param>
 private void InitSizes(IbnDock Control)
 {
     Control.Left     = marginLeft;
     Control.Right    = marginRight;
     Control.Top      = marginTop;
     Control.Bottom   = marginBottom;
     Control.LayoutId = this.ContainerId;
 }
Esempio n. 2
0
        /// <summary>
        /// Handles the LoadComplete event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void Page_LoadComplete(object sender, EventArgs e)
        {
            for (int i = 0; i < this.DockedItems.Count; i++)
            {
                if (this.DockedItems[i] is IbnDock)
                {
                    IbnDock ctrl = (IbnDock)this.DockedItems[i];
                    InitSizes(ctrl);

                    if (ctrl.Anchor == IbnDockType.Bottom)
                    {
                        marginBottom += ctrl.DefaultSize + ctrl.SplitterSizer;
                        if (ctrl.EnableSplitter)
                        {
                            marginBottom += this.BorderSize;
                        }
                    }
                    if (ctrl.Anchor == IbnDockType.Top)
                    {
                        marginTop += ctrl.DefaultSize + ctrl.SplitterSizer;
                        if (ctrl.EnableSplitter)
                        {
                            marginTop += this.BorderSize;
                        }
                    }
                    if (ctrl.Anchor == IbnDockType.Right)
                    {
                        marginRight += ctrl.DefaultSize + ctrl.SplitterSizer;
                        if (ctrl.EnableSplitter)
                        {
                            marginRight += this.BorderSize;
                        }
                    }
                    if (ctrl.Anchor == IbnDockType.Left)
                    {
                        marginLeft += ctrl.DefaultSize + ctrl.SplitterSizer;
                        if (ctrl.EnableSplitter)
                        {
                            marginLeft += this.BorderSize;
                        }
                    }

                    ctrl.DockContainer.Attributes.Add("ibnindex", dockIndex.ToString());
                    dockIndex++;
                    ctrl.DockSplitter.Attributes.Add("ibnindex", dockIndex.ToString());
                    dockIndex++;
                }
            }

            MainLayout.Style.Add("margin-left", string.Format("{0}px", marginLeft));
            MainLayout.Style.Add("margin-right", string.Format("{0}px", marginRight));
            MainLayout.Style.Add("margin-top", string.Format("{0}px", marginTop));
            MainLayout.Style.Add("margin-bottom", string.Format("{0}px", marginBottom));
        }