Пример #1
0
 public void Dispose()
 {
     taskManager.Remove(taskHandle);
     onConfigChanged.Detach();
     configFileWatcher.EnableRaisingEvents = false;
     configFileWatcher.Dispose();
 }
Пример #2
0
        public void Dispose()
        {
            lock (locker)
            {
                taskManager.Remove(taskHandle);

                eventAggregator.Unsubscribe(this);
                onAnyConfigChanged.Detach();
                onAvailableConfigsChanged.Detach();
                foreach (var wurmConfig in nameToConfigMap)
                {
                    wurmConfig.Value.ConfigChanged -= ConfigOnConfigChanged;
                    wurmConfig.Value.Dispose();
                }
            }
        }