protected void RemoveEventNeighPanes()
 {
     var infoArray = new DireInfo[] { Top, Bottom, Left, Right };
     foreach (var info in infoArray)
         foreach (var node in info.Outers)
         {
             var neigh = node.Neigh;
             neigh.PaneAdded -= NeighPane_PaneAdded;
             if (node.Neigh is DockPaneBase.DockNeigh)
             {
                 ((DockPaneBase.DockNeigh)neigh).Removed -= NeighPane_Removed;
                 ((DockPaneBase.DockNeigh)neigh).Removing -= NeighPane_Removing;
             }
         }
 }
 public DockBaseNeigh()
 {
     Top = new DireInfo();
     Bottom = new DireInfo();
     Left = new DireInfo();
     Right = new DireInfo();
     Children = new List<DockPaneBase>();
 }
 protected void AddEventNeighPanes()
 {
     DireInfo[] infos = new DireInfo[] { Top, Bottom, Left, Right };
     foreach (var info in infos)
         foreach (var pane in info.Outers)
         {
             DockBaseNeigh neigh = pane.Neigh;
             neigh.PaneAdded -= NeighPane_PaneAdded;
             neigh.PaneAdded += NeighPane_PaneAdded;
             if (neigh is DockPaneBase.DockNeigh)
             {
                 ((DockPaneBase.DockNeigh)neigh).Removed -= NeighPane_Removed;
                 ((DockPaneBase.DockNeigh)neigh).Removed += NeighPane_Removed;
                 ((DockPaneBase.DockNeigh)neigh).Removing -= NeighPane_Removing;
                 ((DockPaneBase.DockNeigh)neigh).Removing += NeighPane_Removing;
             }
         }
 }