Exemplo n.º 1
0
        private static GoCommands GetBackNextCommand(Window wnd)
        {
            GoCommands cmds = new GoCommands();

            var d = wnd?.DataContext;

            if (d != null)
            {
                cmds.GoBackCommand = d.GetType().GetProperty("GoBack")?.GetValue(d) as ICommand;
                cmds.GoNextCommand = d.GetType().GetProperty("GoNext")?.GetValue(d) as ICommand;
            }
            return(cmds);
        }
Exemplo n.º 2
0
        public static async Task Start(string companyName, MicroServiceEntity entity)
        {
            var projectName = Constants.appNamePrefix + entity.Name.Kebaberize();
            var projectPath = await GoFilePaths.GetProjectPath(companyName, entity.Name);

            await GoCommands.Build(projectPath);

            var buildPath = Path.Combine(projectPath, projectName + ".exe");

            var port        = MachinePorts.GetAvailablePort(3000);
            var runLocation = $"localhost:{port}";

            Console.WriteLine($"Attempting to run {entity.Name} at {runLocation}");

            using (var cli = new Cli(buildPath))
            {
                cli.ExecuteAndForget(runLocation);
                Console.WriteLine($"{entity.Name} running at {runLocation}");
            }
        }