diff --git a/IPA.Loader/Config/ConfigRuntime.cs b/IPA.Loader/Config/ConfigRuntime.cs index 40173293..323df7bf 100644 --- a/IPA.Loader/Config/ConfigRuntime.cs +++ b/IPA.Loader/Config/ConfigRuntime.cs @@ -145,6 +145,11 @@ private static void AddConfigToWatchers(Config config) watcher.EnableRaisingEvents = true; } + internal static FileSystemWatcher[] GetWatchers() + { + return watcherTrackConfigs.Keys.ToArray(); + } + private static void EnsureWritesSane(Config config) { // compare exchange loop to be sane diff --git a/IPA.Loader/Config/ConfigWatchersHelper.cs b/IPA.Loader/Config/ConfigWatchersHelper.cs new file mode 100644 index 00000000..e55b1d2c --- /dev/null +++ b/IPA.Loader/Config/ConfigWatchersHelper.cs @@ -0,0 +1,13 @@ +namespace IPA.Config +{ + public static class ConfigWatchersHelper + { + public static void ToggleWatchers() + { + foreach (var watcher in ConfigRuntime.GetWatchers()) + { + watcher.EnableRaisingEvents = !watcher.EnableRaisingEvents; + } + } + } +}