Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            var ws = new WindowsService();

            var command = new RootCommand(ws.Console);
            var engine  = new CommandEngine(command);

            ws.Start(args);
            engine.Run(args);
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            var rootCommand = new RootCommand(new ClientConsole());

            rootCommand.RegisterCommand(new ExampleCommands());
            rootCommand.RegisterCommand(new TestCommands());
            rootCommand.RegisterCommand(new PdfCommand());
            var engine = new CommandEngine(rootCommand);

            engine.Run(args);
        }
Exemplo n.º 3
0
        public void Initialize()
        {
            RootCommand Root = new RootCommand(Log.Console);

            Root.RegisterCommand(new GoToRoomCommand(Map));
            Root.RegisterCommand(new RoomInfoCommand(Map));
            Root.RegisterCommand(new ListRoomsCommand(Map));
            Root.RegisterCommand(new SetViewCommand(MapRenderer));
            Root.RegisterCommand(new OutlineCommand(MapRenderer));
            Root.RegisterCommand(new DisplayCommand(GameController));
            Root.RegisterCommand(new DisableCommand(MapRenderer));

            CommandEngine Engine = new CommandEngine(Root);

            Engine.Run(new string[0]);
        }
Exemplo n.º 4
0
        private static void Main(string[] args)
        {
            var console = new ClientConsole();

            Effort.Provider.EffortProviderConfiguration.RegisterProvider();
            var connection = DbConnectionFactory.CreateTransient();

            using (var context = new SampleDb(connection, "geo"))
            {
                console.WriteLine("Welcome to EF Test Console, type help to check available commands",
                                  OutputLevel.Information, null);

                context.Products.AddRange(new[]
                {
                    new Product {
                        Name = "CocaCola"
                    },
                    new Product {
                        Name = "Pepsi"
                    },
                    new Product {
                        Name = "Starbucks"
                    },
                    new Product {
                        Name = "Donut"
                    }
                });

                context.SaveChanges();

                var ct = new System.Threading.CancellationToken();
                Task.Run(() => { SingletonSampleJob.Instance.RunBackgroundWork(ct); }, ct);

                var command = new RootCommand(console);

                command.RegisterCommand(new FillOrderCommand(context));
                command.RegisterCommand(new EditOrder(context));
                command.RegisterCommand(new QueryAuditTrail(context));
                command.RegisterCommand(new QueryOrder(context));
                command.RegisterCommand(new ToggleController(context));
                command.RegisterCommand(new JobController(context));

                var commandEngine = new CommandEngine(command);

                commandEngine.Run(args);
            }
        }
Exemplo n.º 5
0
        public static void Main(string[] args)
        {
            //LoadedAssembly();
            if (args.Length == 0)
            {
                SwitchDomainForRazorEngine();
            }
            var console  = new ClientConsole();
            var command  = new RootCommand(console);
            var razorcmd = new RazorCommand();

            command.RegisterCommand(razorcmd);
            command.RegisterCommand(new TestCaseCommand(razorcmd));
            var commandEngine = new CommandEngine(command);

            commandEngine.Run(args);
        }
Exemplo n.º 6
0
 public IEnumerable <T> AsEnumerable <T>(Func <DbDataReader, T> read)
 {
     return(commandEngine.Run(command => ReadEnumerable(command, read)));
 }