Exemplo n.º 1
0
 protected virtual void Dispose(bool disposing)
 {
     // Check to see if Dispose has already been called.
     if (_disposed == false)
     {
         MessagePublishedEventManager.RemoveListener(_source, this);
         _disposed = true;
     }
 }
Exemplo n.º 2
0
            internal IDisposable Subscribe(IMessageListener <TMessage> messageListener)
            {
                var observer = new MessagePublishedWeakEventListener <TMessage>(this, messageListener);

                _observers.Add(new WeakReference(observer));

                MessagePublishedEventManager.AddListener(this, observer);

                return(observer);
            }