Пример #1
0
 private void AppendErrorBox(object sender, ProcessTextReceivedEventArgs args)
 {
     if (rtbErrors.InvokeRequired)
     {
         var d = new BuildSystem.ProcessTextReceivedDelegate(AppendErrorBox);
         BeginInvoke(d, new[] { sender, args });
         return;
     }
     rtbErrors.AppendText(args.Text);
 }
Пример #2
0
        public bool Run(BuildSystem.ProcessTextReceivedDelegate textReceived, string target, params string[] parameters)
        {
            if (string.IsNullOrWhiteSpace(target))
            {
                throw new ArgumentNullException("target");
            }

            var arguments = string.Format("/t:{0}{1}", target,
                                          string.Join("", parameters.Select(p => string.Format(" /p:{0}", p))));

            var buildSystem = BuildSystem.StartRunProcess(Executable, string.Join(" ", arguments),
                                                          Environment.CurrentDirectory, textReceived: textReceived);

            buildSystem.WaitForExit();
            return(buildSystem.ExitCode != 0);
        }
Пример #3
0
 private void ProcessTextReceived(object sender, ProcessTextReceivedEventArgs args)
 {
     if (rtbPatchLog.InvokeRequired)
     {
         var d = new BuildSystem.ProcessTextReceivedDelegate(ProcessTextReceived);
         BeginInvoke(d, new[] { sender, args });
     }
     else
     {
         var text = string.Format("{0}{1}{2}", args.IsError ? "Error: " : string.Empty, args.Text, System.Environment.NewLine);
         rtbPatchLog.AppendText(text);
         rtbPatchLog.SelectionStart = rtbPatchLog.TextLength;
         rtbPatchLog.ScrollToCaret();
         if (args.IsError)
         {
             rtbErrors.AppendText(string.Format("{0}{1}", args.Text, System.Environment.NewLine));
             rtbErrors.SelectionStart = rtbErrors.TextLength;
             rtbErrors.ScrollToCaret();
         }
     }
 }
Пример #4
0
        public bool Run(BuildSystem.ProcessTextReceivedDelegate textReceived, string target, DeploymentTool.Environment buildEnvironment)
        {
            var parameters = GenerateParameters(buildEnvironment);

            return(Run(textReceived, target, parameters));
        }