コード例 #1
0
        /// <summary>
        /// Releases all managed resources.
        /// </summary>
        /// <param name="calledFromFinalizer">Specifies if this method is called from finalizer or not</param>
        private void Dispose(bool calledFromFinalizer)
        {
            if (!_disposed)
            {
                _disposed = true;

                if (_componentRegistry != null)
                {
                    foreach (ComponentRegistration regEntry in _componentRegistry.GetRegistrations())
                    {
                        CleanUpComponentInstance(regEntry);
                    }

                    _componentRegistry.Clear();
                    _componentRegistry = null;
                }

                if (!calledFromFinalizer)
                {
                    GC.SuppressFinalize(this);
                }
            }
        }