Пример #1
0
        public virtual void Remove(TLNode node)
        {
            if (m_lastNode == null)
            {
                return;
            }
            m_version++;
            ClearInternalArray();
            //Debug.Assert(node != null && object.ReferenceEquals(node.Owner, this), "Remove(Node node)");

            TLNode prev = node.PrevSibling;
            TLNode next = node.NextSibling;

            node.Remove();

            if (prev == null) // first node
            {
                m_firstNode = next;
            }
            if (next == null) // last node
            {
                m_lastNode = prev;
            }
            m_IdDirty++;
            m_count--;
            TLNode.SetHasChildren(m_owner, m_count != 0);
        }
Пример #2
0
 public virtual void Clear()
 {
     m_version++;
     while (m_firstNode != null)
     {
         TLNode node = m_firstNode;
         m_firstNode = node.NextSibling;
         node.Remove();
     }
     m_firstNode      = null;
     m_lastNode       = null;
     m_count          = 0;
     m_totalNodeCount = 0;
     m_IdDirty        = 0;
     m_nextId         = 0;
     ClearInternalArray();
     TLNode.SetHasChildren(m_owner, m_count != 0);
 }