/// <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)); }
/// <summary>Called by a child if it has changed.</summary> /// <param name="child">The child.</param> protected internal virtual void ChildHasChanged(BaseNode child) { }
public void InsertBytes(BaseNode position, int size) { InsertBytes(FindNodeIndex(position), size); }
public void AddNode(BaseNode node) { Contract.Requires(node != null); InsertNode(nodes.Count, node); }
public override bool CanHandleChildNode(BaseNode node) { return(node is VirtualMethodNode); }
protected internal override void ChildHasChanged(BaseNode child) { NodesChanged?.Invoke(this); }
public override void CopyFromNode(BaseNode node) { Length = node.MemorySize / CharacterSize; }
/// <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)); }
/// <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)); }
/// <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);
public override bool CanChangeInnerNodeTo(BaseNode node) => node switch {