Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            try
            {
                InitializeComponents();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.InnerException?.Message ?? ex.Message);
                return;
            }

            if (args.Length != 0)
            {
                CommandsBuilder.RunCommands(args);
                return;
            }

            var runningType = SolutionConfiguration.RunningType;

            Console.WriteLine($"Try to running {runningType}");

            IRunningType command;

            switch (runningType)
            {
                case "Webhook":
                    command = new WebhookType();
                    break;
                case "Echo":
                    command = new EchoType();
                    break;
                default:
                    throw new Exception($"Invalid type {runningType}");
            }

            command.Run();
        }