Exemplo n.º 1
0
        /// <summary>Removes the specified node.</summary>
        /// <param name="node">The node to remove.</param>
        /// <returns>True if it succeeds, false if it fails.</returns>
        public virtual bool RemoveNode(BaseNode node)
        {
            Contract.Requires(node != null);

            return(nodes.Remove(node));
        }
Exemplo n.º 2
0
 /// <summary>Called by a child if it has changed.</summary>
 /// <param name="child">The child.</param>
 protected internal virtual void ChildHasChanged(BaseNode child)
 {
 }
Exemplo n.º 3
0
 public void InsertBytes(BaseNode position, int size)
 {
     InsertBytes(FindNodeIndex(position), size);
 }
Exemplo n.º 4
0
        public void AddNode(BaseNode node)
        {
            Contract.Requires(node != null);

            InsertNode(nodes.Count, node);
        }
 public override bool CanHandleChildNode(BaseNode node)
 {
     return(node is VirtualMethodNode);
 }
Exemplo n.º 6
0
 protected internal override void ChildHasChanged(BaseNode child)
 {
     NodesChanged?.Invoke(this);
 }
Exemplo n.º 7
0
 public override void CopyFromNode(BaseNode node)
 {
     Length = node.MemorySize / CharacterSize;
 }
Exemplo n.º 8
0
        /// <summary>
        /// Tries to get the successor of the given node in the container.
        /// </summary>
        /// <param name="node">The root node.</param>
        /// <param name="successor">The successor of the given node.</param>
        /// <returns>True if a successor exists, otherwise false.</returns>
        public bool TryGetSuccessor(BaseNode node, out BaseNode successor)
        {
            Contract.Requires(node != null);

            return(TryGetNeighbour(node, 1, out successor));
        }
Exemplo n.º 9
0
        /// <summary>
        /// Tries to get the predecessor of the given node in the container.
        /// </summary>
        /// <param name="node">The root node.</param>
        /// <param name="predecessor">The predecessor of the given node.</param>
        /// <returns>True if a predecessor exists, otherwise false.</returns>
        public bool TryGetPredecessor(BaseNode node, out BaseNode predecessor)
        {
            Contract.Requires(node != null);

            return(TryGetNeighbour(node, -1, out predecessor));
        }
Exemplo n.º 10
0
 /// <summary>
 /// Should be called before <see cref="ChangeInnerNode"/> to test if the node can handle the inner node type.
 /// </summary>
 /// <param name="node">The new inner node type.</param>
 /// <returns>True if the class can handle the inner node type or false otherwise.</returns>
 public abstract bool CanChangeInnerNodeTo(BaseNode node);
Exemplo n.º 11
0
 public override bool CanChangeInnerNodeTo(BaseNode node) =>
 node switch
 {