private void RemoveTaskOutputWindow(TaskOutputWindow taskOutputWindow) { _TaskOutputWindows.Remove(taskOutputWindow); }
private void RunVagrantAction(string action, VagrantInstance instance) { string command; if (action == "up") { command = String.Format("vagrant up{0}", !String.IsNullOrEmpty(instance.ProviderIdentifier) ? String.Format(" --provider={0}", instance.ProviderIdentifier) : "virtualbox"); } else if (action == "reload") { command = "vagrant reload"; } else if (action == "suspend") { command = "vagrant suspend"; } else if (action == "halt") { command = "vagrant halt"; } else if (action == "provision") { command = "vagrant provision"; } else if (action == "destroy") { command = "vagrant destroy -f"; } else { return; } Process process = new Process(); process.StartInfo.FileName = "cmd"; process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; process.StartInfo.CreateNoWindow = true; process.StartInfo.UseShellExecute = false; process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true; process.StartInfo.Arguments = String.Format("/C cd /d {0} && {1}", Util.EscapeShellArg(instance.Path), command); TaskOutputWindow outputWindow = new TaskOutputWindow(); outputWindow.Task = process; outputWindow.TaskCommand = process.StartInfo.Arguments; outputWindow.TaskAction = command; outputWindow.Target = instance; outputWindow.Show(); _TaskOutputWindows.Add(outputWindow); }