public void Replace(ListNode oldNode, ListNode newNode) { lock (this) { newNode.Remove(); newNode.list = this; if (oldNode.prev == null) { first = newNode; } else { oldNode.prev.next = newNode; } if (oldNode.next == null) { last = newNode; } else { oldNode.next.prev = newNode; } newNode.prev = oldNode.prev; newNode.next = oldNode.next; } }
public void Add( ListNode node ) { lock( this ) { node.Remove(); node.list = this; node.prev = last; if( first == null ) first = node; else last.next = node; last = node; } }
public void Add( ListNode node, ListNode newNode ) { lock( this ) { newNode.Remove(); newNode.list = this; newNode.next = node.next; newNode.prev = node; if( node.next == null ) last = newNode; else node.next.prev = newNode; node.next = newNode; } }
public void Add(ListNode node) { lock (this) { node.Remove(); node.list = this; node.prev = last; if (first == null) { first = node; } else { last.next = node; } last = node; } }
public void Replace( ListNode oldNode, ListNode newNode ) { lock( this ) { newNode.Remove(); newNode.list = this; if( oldNode.prev == null ) first = newNode; else oldNode.prev.next = newNode; if( oldNode.next == null ) last = newNode; else oldNode.next.prev = newNode; newNode.prev = oldNode.prev; newNode.next = oldNode.next; } }
public void Add(ListNode node, ListNode newNode) { lock (this) { newNode.Remove(); newNode.list = this; newNode.next = node.next; newNode.prev = node; if (node.next == null) { last = newNode; } else { node.next.prev = newNode; } node.next = newNode; } }
public void Insert(ListNode node, ListNode newNode) { lock (this) { newNode.Remove(); newNode.list = this; newNode.prev = node.prev; newNode.next = node; if (node.prev == null) { first = newNode; } else { node.prev.next = newNode; } node.prev = newNode; } }
public void Insert( ListNode node, ListNode newNode ) { lock( this ) { newNode.Remove(); newNode.list = this; newNode.prev = node.prev; newNode.next = node; if( node.prev == null ) first = newNode; else node.prev.next = newNode; node.prev = newNode; } }