private void ExecuteBariAction(string actionName, Action <bool> after = null) { var solutionInfo = new SolutionInfo(GetDte()); CancelAnyPreviousBariAction(); var output = owner.GetService <SVsOutputWindow>() as IVsOutputWindow; var bariOutputPane = new BariOutputPane(output); bariOutputPane.Clear(); bariOutputPane.WriteLine(string.Format("Executing bari {0}...\n", actionName)); var workingDirectory = solutionInfo.BariWorkingDirectory; var bariConfig = solutionInfo.BariConfig; bariShell = new BariShell(bariConfig.BariPath, bariConfig.Goal, bariConfig.Target, workingDirectory, bariOutputPane); bariShell.ExecuteAsync(actionName, cancelled => { CancelAnyPreviousBariAction(); if (!cancelled) { isBuildNeeded = false; } if (after != null) { after(cancelled); } }); }
public void CancelAnyPreviousBariAction() { if (bariShell != null) { bariShell.CancelAll(); bariShell = null; } }