Esempio n. 1
0
        public void Main(string[] args)
        {
            //Debugger.Launch();
            //Debugger.Break();

            var generatorsLocator = _serviceProvider.GetRequiredService <ICodeGeneratorLocator>();
            var logger            = _serviceProvider.GetRequiredService <ILogger>();

            if (args == null || args.Length == 0 || IsHelpArgument(args[0]))
            {
                ShowCodeGeneratorList(generatorsLocator.CodeGenerators);
                return;
            }

            try
            {
                var codeGeneratorName = args[0];

                logger.LogMessage("Finding the generator '" + codeGeneratorName + "'...");
                var generatorDescriptor = generatorsLocator.GetCodeGenerator(codeGeneratorName);

                var actionInvoker = new ActionInvoker(generatorDescriptor.CodeGeneratorAction);

                logger.LogMessage("Running the generator '" + codeGeneratorName + "'...");
                actionInvoker.Execute(args);
            }
            catch (Exception ex)
            {
                logger.LogMessage(ex.Message);
            }
        }
Esempio n. 2
0
        public void Main(string[] args)
        {
            //Debugger.Launch();
            //Debugger.Break();

            var generatorsLocator = _serviceProvider.GetRequiredService<ICodeGeneratorLocator>();
            var logger = _serviceProvider.GetRequiredService<ILogger>();

            if (args == null || args.Length == 0 || IsHelpArgument(args[0]))
            {
                ShowCodeGeneratorList(generatorsLocator.CodeGenerators);
                return;
            }

            try
            {
                var codeGeneratorName = args[0];

                logger.LogMessage("Finding the generator '" + codeGeneratorName + "'...");
                var generatorDescriptor = generatorsLocator.GetCodeGenerator(codeGeneratorName);

                var actionInvoker = new ActionInvoker(generatorDescriptor.CodeGeneratorAction);

                logger.LogMessage("Running the generator '" + codeGeneratorName + "'...");
                actionInvoker.Execute(args);
            }
            catch (Exception ex)
            {
                logger.LogMessage(ex.Message);
            }
        }
Esempio n. 3
0
        public void Main(string[] args)
        {
            //Console.WriteLine("Attach Debugger");
            //Console.Read();

            var generatorsLocator = _serviceProvider.GetService <ICodeGeneratorLocator>();

            if (args == null || args.Length == 0)
            {
                ShowCodeGeneratorList(generatorsLocator.CodeGenerators);
                return;
            }

            var codeGeneratorName   = args[0];
            var generatorDescriptor = generatorsLocator.GetCodeGenerator(codeGeneratorName);

            var actionInvoker = new ActionInvoker(generatorDescriptor.CodeGeneratorAction);

            actionInvoker.Execute(args);
        }