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