Beispiel #1
0
        /// <summary>
        /// For nunit-teardown
        /// </summary>
        internal void ForceShutDownAllApps()
        {
            IDictionaryEnumerator i = mExtensionApps.GetEnumerator();

            while (i.MoveNext())
            {
                IExtensionApplication app = i.Value as IExtensionApplication;
                if (null != app)
                {
                    app.ShutDown();
                }
            }
        }
        private void Terminate()
        {
            AppDomain currentDomain = AppDomain.CurrentDomain;

            currentDomain.AssemblyLoad    -= new AssemblyLoadEventHandler(OnAssemblyLoad);
            currentDomain.AssemblyResolve -= new ResolveEventHandler(OnAssemblyResolve);
            currentDomain.ProcessExit     -= new EventHandler(OnDomainUnload);

            IDictionaryEnumerator i = mExtensionApps.GetEnumerator();

            while (i.MoveNext())
            {
                IExtensionApplication app = i.Value as IExtensionApplication;
                if (null != app)
                {
                    app.ShutDown();
                }
            }
            mExtensionApps.Clear();
            mAssemblies.Clear();
        }