コード例 #1
0
        public void Notify()
        {
            ColListener pNode = this.pHead;

            while (pNode != null)
            {
                // Fire off Observer
                pNode.Notify();

                pNode = (ColListener)pNode.pNext;
            }
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
 // Obserbver
 public void Attach(ColListener Listener)
 {
     this.pObserver.Attach(Listener);
 }