Beispiel #1
0
        protected virtual void Dispose(bool disposing)
        {
            if (Disposed)
            {
                return;
            }

            if (disposing)
            {
                if (EventListeners.Count != 0)
                {
                    EventListeners.Dispose();
                    if (_isDisposableType)
                    {
                        foreach (var unknown in CurrentCollection)
                        {
                            var i = (IDisposable)unknown;
                            i.Dispose();
                        }
                    }
                    CurrentCollection.Clear();
                }
            }
            Disposed = true;
        }