public void PlaceBefore(IDualLinkNode <TEntity> sourceNode, IDualLinkNode <TEntity> targetNode) { DualLinkNode <TEntity> source = FindNode(sourceNode); DualLinkNode <TEntity> target = FindNode(targetNode); if (source != target) { target.AttachBefore(source); RealignEnds(); } }
public IDualLinkNode <TEntity> AddBefore(IDualLinkNode <TEntity> suppliedNode, TEntity entity) { DualLinkNode <TEntity> sourceNode = FindNode(suppliedNode); DualLinkNode <TEntity> newNode = new DualLinkNode <TEntity>(this, entity); if (sourceNode != null) { newNode.AttachBefore(sourceNode); } AddElement(newNode); return(newNode); }