示例#1
0
        public Layout.SpNode GetNode()
        {
            var node = new Layout.SpNode();

            if (scPanel.Panel1Collapsed == false)
            {
                node.Left = lPanel.GetLayout();
            }
            if (scPanel.Panel2Collapsed == false)
            {
                node.Right = rPanel.GetLayout();
            }
            node.Orientation = scPanel.Orientation == Orientation.Horizontal ? 1 : 2;
            node.SplitDist   = scPanel.SplitterDistance / (decimal)(scPanel.Orientation == Orientation.Horizontal ? scPanel.Height : scPanel.Width);
            return(node);
        }
示例#2
0
 public void SetNode(Layout.SpNode node)
 {
     if (node == null)
     {
         return;
     }
     SetDirection(node.Orientation == 1 ? Orientation.Horizontal : Orientation.Vertical,
                  (int)(node.SplitDist * (node.Orientation == 1 ? scPanel.Height : scPanel.Width)));
     if (node.Left != null)
     {
         lPanel.SetLayout(node.Left);
         scPanel.Panel1Collapsed = false;
     }
     if (node.Right != null)
     {
         rPanel.SetLayout(node.Right);
         scPanel.Panel2Collapsed = false;
     }
 }