public void Hooks_Test() { var config = ConfigDeserializer.Deserialize("hooks.yml"); var manager = new HooksManager(); manager.RegisterHooks(config.Hooks); Assert.AreEqual(manager.Hooks[0], new Hook { Mode = HookMode.Common, Type = HookType.Post, Event = HookEvent.AssetsMerge, Command = "a" }); Assert.AreEqual(manager.Hooks[1], new Hook { Mode = HookMode.Common, Type = HookType.Post, Event = HookEvent.AssetsMerge, Command = "b" }); Assert.AreEqual(manager.Hooks[2], new Hook { Mode = HookMode.Test, Type = HookType.Post, Event = HookEvent.SubtitlesUpdate, Command = "d" }); }
static void currentExit(object sender, ExitEventArgs e) { HooksManager.UnloadChannel(); }
static void currentSessionEnding(object sender, SessionEndingCancelEventArgs e) { HooksManager.UnloadChannel(); }
static void mainWindowLoaded(object sender, RoutedEventArgs e) { Application.Current.MainWindow.WindowState = WindowState.Minimized; HooksManager.StartChannel(); }