Beispiel #1
0
        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;
            }
        }
Beispiel #2
0
        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;
            }
        }
Beispiel #3
0
        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;
            }
        }
Beispiel #4
0
        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;
            }
        }
Beispiel #5
0
        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;
            }
        }
Beispiel #6
0
        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;
            }
        }
Beispiel #7
0
        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;
            }
        }
Beispiel #8
0
        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;
            }
        }