示例#1
0
 internal EventNotify(ISpEventSource sapiEventSource, IAsyncDispatch dispatcher, bool additionalSapiFeatures)
 {
     _sapiEventSourceReference = new WeakReference(sapiEventSource);
     _dispatcher             = dispatcher;
     _additionalSapiFeatures = additionalSapiFeatures;
     _notifySink             = new SpNotifySink(this);
     sapiEventSource.SetNotifySink(_notifySink);
 }
示例#2
0
 internal void Dispose()
 {
     lock (this)
     {
         if (_sapiEventSourceReference != null)
         {
             ISpEventSource spEventSource = (ISpEventSource)_sapiEventSourceReference.Target;
             if (spEventSource != null)
             {
                 spEventSource.SetNotifySink(null);
                 _notifySink = null;
             }
         }
         _sapiEventSourceReference = null;
     }
 }