protected virtual void SetChildPaneConfig(DockConfig config, List<DockPaneBase> panes)
 {
     foreach (DockConfig c in config.ChildNode)
     {
         panes[c.Index].SetChildPaneConfig(c, panes);
     }
 }
        public virtual void SetConfig(DockConfig config)
        {
            var panes = new List<DockPaneBase>(Panes);
            while (Panes.Count > 0)
                Panes[0].Remove();

            SetChildPaneConfig(config, panes);
        }
 protected void AddChildPane(DockConfig config)
 {
     for (int i = 0; i < config.ChildNode.Count; i++)
     {
         var c = (DockPaneConfig)config.ChildNode[i];
         config.Node.AddPane((DockPaneBase)c.Node, c.Direction, c.SplitRate);
         AddChildPane(c);
     }
 }
 protected virtual void GetChildPaneConfig(DockConfig config)
 {
     config.Node = this;
     foreach (var pane in Neigh.Children)
     {
         var sconfig = pane.CreateConfig();
         sconfig.ParentNode = config;
         config.ChildNode.Add(sconfig);
         pane.GetChildPaneConfig(sconfig);
     }
 }
        protected override void GetChildPaneConfig(DockConfig config)
        {
            if (config is DockBayConfig)
                ((DockBayConfig)config).ChildCount = Panes.Count;

            config.Index = -1;
            config.Width = ((double)Width) / ((double)Neigh.Owner.Width);
            config.Height = ((double)Height) / ((double)Neigh.Owner.Height);
            base.GetChildPaneConfig(config);
        }
        protected override void SetChildPaneConfig(DockConfig config, List<DockPaneBase> panes)
        {
            if ((config is DockBayConfig) && (panes.Count != ((DockBayConfig)config).ChildCount))
            {
                throw new ArgumentException("引数configが持つノードの総数が自身の所有していたノードの総数と一致しません。");
            }
            foreach (DockPaneConfig config2 in config.ChildNode)
            {
                DockPaneBase pane = panes[config2.Index];
                AddPane(pane, config2.Direction);
            }
            for (int i = config.ChildNode.Count - 1; i >= 1; i--)
            {
                int num;
                DockPaneBase base3 = panes[config.ChildNode[i].Index];
                switch (((DockPaneBase.DockNeigh)base3.Neigh).Align)
                {
                    case DockDirection.Top:
                        num = ((int)((Height * config.ChildNode[i].Height) + 0.5)) - base3.Height;
                        base3.MoveSplitter(DockDirection.Bottom, num);
                        break;

                    case DockDirection.Bottom:
                        num = ((int)((Height * config.ChildNode[i].Height) + 0.5)) - base3.Height;
                        base3.MoveSplitter(DockDirection.Top, num);
                        break;

                    case DockDirection.Left:
                        num = ((int)((Width * config.ChildNode[i].Width) + 0.5)) - base3.Width;
                        base3.MoveSplitter(DockDirection.Right, num);
                        break;

                    case DockDirection.Right:
                        num = ((int)((Width * config.ChildNode[i].Width) + 0.5)) - base3.Width;
                        base3.MoveSplitter(DockDirection.Left, num);
                        break;

                    default:
                        throw new Exception("なにやらサイズ復元中のPaneのDirectionがTop,Bottom,Left,Right以外になってまっせ。");
                }
            }
            base.SetChildPaneConfig(config, panes);
        }
 protected override void GetChildPaneConfig(DockConfig config)
 {
     config.Index = Neigh.Owner.Panes.IndexOf(this);
     ((DockPaneConfig)config).Direction = ((DockNeigh)Neigh).Align;
     ((DockPaneConfig)config).SplitRate = GetSplitRate();
     Size includingSizeOfChildNodes = IncludingSizeOfChildNodes;
     config.Width = ((double)includingSizeOfChildNodes.Width) / ((double)Neigh.Owner.Width);
     config.Height = ((double)includingSizeOfChildNodes.Height) / ((double)Neigh.Owner.Height);
     base.GetChildPaneConfig(config);
 }
 protected override void SetChildPaneConfig(DockConfig config, List<DockPaneBase> panes)
 {
     foreach (DockPaneConfig c in config.ChildNode)
     {
         var pane = panes[c.Index];
         AddPane(pane, c.Direction, c.SplitRate);
     }
     base.SetChildPaneConfig(config, panes);
 }