コード例 #1
0
        public int Execute()
        {
            // Ignore Ctrl-C for the remainder of the command's execution
            // Forwarding commands will just spawn the child process and exit
            Console.CancelKeyPress += (sender, e) => { e.Cancel = true; };

            return(_forwardingApp.Execute());
        }
コード例 #2
0
        public int Execute()
        {
            try
            {
                Environment.SetEnvironmentVariable(TelemetrySessionIdEnvironmentVariableName, Telemetry.CurrentSessionId);

                return(_forwardingApp.Execute());
            }
            finally
            {
                Environment.SetEnvironmentVariable(TelemetrySessionIdEnvironmentVariableName, null);
            }
        }
コード例 #3
0
        private void AddProject(string slnPath, string csprojPath)
        {
            List<string> args = new List<string>()
                {
                    "sln",
                    slnPath,
                    "add",
                    csprojPath,
                };

            var dotnetPath = Path.Combine(AppContext.BaseDirectory, "dotnet.dll");
            var addCommand = new ForwardingApp(dotnetPath, args);
            addCommand.Execute();
        }
コード例 #4
0
        private void RunDotnetSlnCommand(string slnPath, string projPath, string commandName)
        {
            var args = new List <string>()
            {
                "sln",
                slnPath,
                commandName,
                projPath,
            };

            var dotnetPath = Path.Combine(AppContext.BaseDirectory, "dotnet.dll");
            var command    = new ForwardingApp(dotnetPath, args);

            command.Execute();
        }
コード例 #5
0
 public int Execute()
 {
     return(_forwardingApp.Execute());
 }