Exemple #1
0
 /// <summary>
 /// <para>Releases the unmanaged resources used by the <see cref="Cinchoo.Core.Configuration.ConfigurationChangeFileWatcher"/> and optionally releases the managed resources.</para>
 /// </summary>
 /// <param name="isDisposing">
 /// <para><see langword="true"/> to release both managed and unmanaged resources; <see langword="false"/> to release only unmanaged resources.</para>
 /// </param>
 protected virtual void Disposing(bool isDisposing)
 {
     if (isDisposing)
     {
         _eventHandlerList.Clear();
     }
 }
Exemple #2
0
        private static void StopGlobalQueuedExecutionService()
        {
            lock (_globalQueuedExecutionServices.SyncRoot)
            {
                foreach (string name in _globalQueuedExecutionServices.ToKeysArray())
                {
                    if (ChoTraceSwitch.Switch.TraceVerbose)
                    {
                        Trace.WriteLine("Stopping {0} Q execution service...".FormatString(name));
                    }

                    try
                    {
                        _globalQueuedExecutionServices[name].Dispose();
                    }
                    catch (ThreadAbortException)
                    {
                        Thread.ResetAbort();
                    }
                    catch (Exception)
                    {
                    }
                }

                _globalQueuedExecutionServices.Clear();
            }
        }
Exemple #3
0
 private static void DisposeAll()
 {
     foreach (ChoIniDocument iniDocument in _iniDocuments.ToValuesArray())
     {
         if (iniDocument == null)
         {
             continue;
         }
         iniDocument.Dispose();
     }
     _iniDocuments.Clear();
 }
        public static void Clear()
        {
            lock (_assemblyCache.SyncRoot)
            {
                _assemblyCache.Clear();
                _missingAssemblyCache.Clear();

                //REVISIT
                //ChoMissingAssemblies.Me.Initialize();
                //ChoLoadedAssemblies.Me.Initialize();
            }
        }
 public static void Cleanup()
 {
     if (_dictService != null)
     {
         foreach (IChoConfigurationChangeWatcher configurationChangeWatcher in _dictService.ToValuesArray())
         {
             if (configurationChangeWatcher != null)
             {
                 configurationChangeWatcher.StopWatching();
             }
         }
         _dictService.Clear();
     }
 }
Exemple #6
0
        public static void DisposeAll()
        {
            lock (MemberProfileCache.SyncRoot)
            {
                foreach (IChoProfile profile in MemberProfileCache.ToValuesArray())
                {
                    //SetAsNotDisposed(profile, true);

                    if (profile is IDisposable)
                    {
                        ((IDisposable)profile).Dispose();
                    }
                }
                MemberProfileCache.Clear();
            }
        }
Exemple #7
0
        private static void StopGlobalQueuedExecutionService()
        {
            lock (_globalQueuedExecutionServices.SyncRoot)
            {
                foreach (string name in _globalQueuedExecutionServices.ToKeysArray())
                {
                    if (ChoTrace.ChoSwitch.TraceVerbose)
                    {
                        Trace.WriteLine("Stopping {0} execution service...".FormatString(name));
                    }
                    _globalQueuedExecutionServices[name].Dispose();
                }

                _globalQueuedExecutionServices.Clear();
            }
        }
Exemple #8
0
        //[ChoAppDomainUnloadMethod("Disposing all profile objects...")]
        public static void DisposeAll()
        {
            lock (MemberProfileCache.SyncRoot)
            {
                foreach (IChoProfile profile in MemberProfileCache.ToValuesArray())
                {
                    //SetAsNotDisposed(profile, true);

                    if (profile is IDisposable)
                    {
                        ((IDisposable)profile).Dispose();
                    }
                }
                MemberProfileCache.Clear();
            }
            lock (_profileCacheLock)
            {
                if (_profileCache != null)
                {
                    _profileCache.ForEach((keyValue) => keyValue.Value.Dispose());
                    _profileCache.Clear();
                }
            }
        }