示例#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;
            }
        }
示例#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;
            }
        }
示例#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;
            }
        }
示例#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;
            }
        }
示例#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;
            }
        }
示例#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;
            }
        }
示例#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;
            }
        }
示例#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;
            }
        }