override public void Remove(Component pComponent) { Debug.Assert(pComponent != null); DLink.RemoveFromList(ref this.pHead, pComponent); this.numChildren -= 1; }
/// <summary> /// Moves a node from active to reserve and cleans list references for node /// </summary> /// <param name="pNode"></param> protected void BaseRemove(DLink pNode) { Debug.Assert(pNode != null); // Update list pointers to remove pNode from list DLink.RemoveFromList(ref pActive, pNode); // Remove list references in removed node pNode.ClearLinks(); // Return pNode to pReserve list DLink.AddToFront(ref pReserve, pNode); // stats update this.activeNodeNum--; this.reserveNodeNum++; }
public void DetachAllObservers() { DLink pNode = this.head; DLink pTmpNode; while (pNode != null) { // Walk through the list pTmpNode = pNode; pNode = pNode.GetNext(); // Clear and remove node Debug.Assert(pTmpNode != null); DLink.RemoveFromList(ref this.head, pTmpNode); pTmpNode = null; } }
//---------------------------------------------------------------------- // Private methods //---------------------------------------------------------------------- private void ClearList(DLink listHead) { DLink pNode; DLink pTmpNode; pNode = listHead; while (pNode != null) { // Walk through the list pTmpNode = pNode; pNode = pNode.GetNext(); // Clear and remove node Debug.Assert(pTmpNode != null); this.DerivedDestroyNode(pTmpNode); DLink.RemoveFromList(ref listHead, pTmpNode); pTmpNode = null; } }
private void ClearList(DLink listHead) { DLink pNode; DLink pTmpNode; pNode = listHead; while (pNode != null) { // Walk through the list pTmpNode = pNode; pNode = pNode.GetNext(); // Clear and remove node Debug.Assert(pTmpNode != null); this.DerivedDestroyNode(pTmpNode); DLink.RemoveFromList(ref this.pActive, pTmpNode); pTmpNode = null; // Decrement total count this.totalNodeNum--; } }