Beispiel #1
0
        public virtual void Dock(IDockTile dockie, DockTileDirection dockDirection)
        {
            ISplitDockTile node = null;
            switch (dockDirection)
            {
                case DockTileDirection.Left:
                case DockTileDirection.Right:
                    node = new HorizontalSplitViewModel();
                    break;
                case DockTileDirection.Top:
                case DockTileDirection.Bottom:
                    node = new VerticalSplitViewModel();
                    break;
            }
            switch (dockDirection)
            {
                case DockTileDirection.Left:
                case DockTileDirection.Top:
                    node.LeftNode = dockie;
                    node.RightNode = this;
                    break;
                case DockTileDirection.Right:
                case DockTileDirection.Bottom:
                    node.LeftNode = this;
                    node.RightNode = dockie;
                    break;
            }

            Parent.ReplaceNode(this, node);
            //Place both parents DOH!
            this.Parent = node;
            dockie.Parent = node;
        }
 public void ReplaceNode(IDockTile CurrentNode, IDockTile nd)
 {
     if (Item == CurrentNode)
     {
         Item.Parent = null;
         Item        = nd;
         Item.Parent = this;
     }
 }
Beispiel #3
0
 public void ReplaceNode(IDockTile CurrentNode, IDockTile nd)
 {
     if (Item == CurrentNode)
     {
         Item.Parent = null;
         Item = nd;
         Item.Parent = this;
     }
 }
 public void RemoveDockTile(IDockTile dockTile)
 {
     if (Parent != null)
     {
         if (dockTile == LeftNode)
             Parent.ReplaceNode(this, RightNode);
         else
             Parent.ReplaceNode(this, LeftNode);
     }
     LeftNode = null;
     RightNode = null;
 }
        /// <summary>
        /// Removes Object from DockTiles
        /// </summary>
        /// <param name="tile">The object that will be removed if it is in the Tiles</param>
        /// <returns></returns>
        public bool RemoveTile(Object tile)
        {
            IDockTile baseDockTile = null;

            ObjectToDocktileMap.TryGetValue(tile, out baseDockTile);
            if (baseDockTile != null)
            {
                (baseDockTile.Parent as ISplitDockTile).RemoveDockTile(baseDockTile);
                ObjectToDocktileMap.Remove(tile);
                return(true);
            }
            return(false);
        }
Beispiel #6
0
 public void RemoveDockTile(IDockTile dockTile)
 {
     if (Parent != null)
     {
         if (dockTile == LeftNode)
         {
             Parent.ReplaceNode(this, RightNode);
         }
         else
         {
             Parent.ReplaceNode(this, LeftNode);
         }
     }
     LeftNode  = null;
     RightNode = null;
 }
 public void ReplaceNode(IDockTile leafViewModel, IDockTile nd)
 {
     if (LeftNode == leafViewModel)
     {
         LeftNode.Parent = null;
         LeftNode = nd;
         nd.Parent = this;
     }
     else
     {
         if (RightNode == leafViewModel)
         {
             RightNode.Parent = null;
             RightNode = nd;
             nd.Parent = this;
         }
     }
 }
Beispiel #8
0
 public void ReplaceNode(IDockTile leafViewModel, IDockTile nd)
 {
     if (LeftNode == leafViewModel)
     {
         LeftNode.Parent = null;
         LeftNode        = nd;
         nd.Parent       = this;
     }
     else
     {
         if (RightNode == leafViewModel)
         {
             RightNode.Parent = null;
             RightNode        = nd;
             nd.Parent        = this;
         }
     }
 }
 /// <summary>
 /// Adds a new Item to the DockTile Configuration
 /// </summary>
 /// <param name="destinationItem">This is the base item that the new item will dock to</param>
 /// <param name="item">This is the item that you wish to display, this item cannot already be apart of the DockTiles</param>
 /// <param name="dockDirection">The basic cardinal direction of that the item will dock to the base item</param>
 public void AddTile(Object destinationItem, Object item, DockTileDirection dockDirection)
 {
     // NOTE(MATTHEW): if we have the item in the map and the person is not docking an item to itself.
     if (ObjectToDocktileMap.ContainsKey(item) || ObjectToDocktileMap.ContainsValue(item as IDockTile))
     {
         // TODO(Matthew):  decide what the default behavior for this stuff truly is.
         throw new Exception();
     }
     if (destinationItem != item && ObjectToDocktileMap.ContainsKey(destinationItem))
     {
         IDockTile baseDockTile = null;
         IDockTile dockedItem   = new LeafViewModel()
         {
             Item = item
         };
         ObjectToDocktileMap.TryGetValue(destinationItem, out baseDockTile);
         ObjectToDocktileMap.Add(item, dockedItem);
         if (baseDockTile.Parent != null)
         {
             baseDockTile.Dock(dockedItem, dockDirection);
         }
     }
 }
        public virtual void Dock(IDockTile dockie, DockTileDirection dockDirection)
        {
            ISplitDockTile node = null;

            switch (dockDirection)
            {
            case DockTileDirection.Left:
            case DockTileDirection.Right:
                node = new HorizontalSplitViewModel();
                break;

            case DockTileDirection.Top:
            case DockTileDirection.Bottom:
                node = new VerticalSplitViewModel();
                break;
            }
            switch (dockDirection)
            {
            case DockTileDirection.Left:
            case DockTileDirection.Top:
                node.LeftNode  = dockie;
                node.RightNode = this;
                break;

            case DockTileDirection.Right:
            case DockTileDirection.Bottom:
                node.LeftNode  = this;
                node.RightNode = dockie;
                break;
            }

            Parent.ReplaceNode(this, node);
            //Place both parents DOH!
            this.Parent   = node;
            dockie.Parent = node;
        }