public void Notify() { ColListener pNode = this.pHead; while (pNode != null) { // Fire off Observer pNode.Notify(); pNode = (ColListener)pNode.pNext; } }
public void Attach(ColListener Listener) { // protection Debug.Assert(Listener != null); Listener.pSubject = this; // add to front if (pHead == null) { pHead = Listener; Listener.pNext = null; Listener.pPrev = null; } else { Listener.pNext = pHead; pHead.pPrev = Listener; pHead = Listener; } }
// Obserbver public void Attach(ColListener Listener) { this.pObserver.Attach(Listener); }