Exemple #1
0
        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"
            });
        }
Exemple #2
0
 static void currentExit(object sender, ExitEventArgs e)
 {
     HooksManager.UnloadChannel();
 }
Exemple #3
0
 static void currentSessionEnding(object sender, SessionEndingCancelEventArgs e)
 {
     HooksManager.UnloadChannel();
 }
Exemple #4
0
 static void mainWindowLoaded(object sender, RoutedEventArgs e)
 {
     Application.Current.MainWindow.WindowState = WindowState.Minimized;
     HooksManager.StartChannel();
 }