public void Dispose() { taskManager.Remove(taskHandle); onConfigChanged.Detach(); configFileWatcher.EnableRaisingEvents = false; configFileWatcher.Dispose(); }
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(); } } }