public CachingWaiter(UIEventWaiter waiter) { Validate.ArgumentNotNull(parameter: waiter, parameterName: nameof(waiter)); this._eventQueue = new Queue <WaiterEventArgs>(); this._resetEvent = new ManualResetEvent(initialState: false); this._shutdown = false; this._disposed = false; this._waiter = waiter; this._syncRoot = new object(); this._waiter.Notify += NotifyHandler; }
protected virtual void Dispose(bool disposing) { if (!this._disposed) { if (disposing) { this._waiter.Notify -= NotifyHandler; this._eventQueue.Clear(); if (this._timer != null) { this._timer.Dispose(); } this._resetEvent.Dispose(); } this._resetEvent = null; this._eventQueue = null; this._waiter = null; this._source = null; this._timer = null; } this._disposed = true; }