Example #1
0
        private static void RunCommands(object obj)
        {
            // todo: copied code

            switch (obj)
            {
            case ContextMenuCommand c1:
            {
                var c = (IIntegrated)c1;
                RunIntegrated(c, ContextMenuCommand.Add, ContextMenuCommand.Remove);

                break;
            }

            case PathCommand c1:
            {
                var c = (IIntegrated)c1;
                RunIntegrated(c, PathCommand.Add, PathCommand.Remove);

                break;
            }

            case CreateSauceNaoCommand c:
            {
                var acc = SauceNao.CreateAccount(c.Auto);

                CliOutput.WriteInfo("Account information:");

                var accStr = acc.ToString();
                var output = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
                             + "\\saucenao_account.txt";

                File.WriteAllText(output, accStr);

                Console.WriteLine(accStr);

                CliOutput.WriteInfo("Adding key to cfg file");
                RuntimeInfo.Config.SauceNaoAuth = acc.ApiKey;
                RuntimeInfo.Config.WriteToFile();
                break;
            }

            case ResetCommand c:
            {
                ResetCommand.RunReset(c.All);
                break;
            }

            case InfoCommand c:
            {
                InfoCommand.Show();
                break;
            }
            }
        }