Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
        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);
        }