public VisualStudioInstance(SolutionFile solution) { _solution = solution; _app = new VisualStudioApp(); Project = _app.OpenProject(solution.Filename); ThreadHelper.Generic.Invoke(Keyboard.Reset); _solutionExplorer = _app.OpenSolutionExplorer(); SelectSolutionNode(); }
public VisualStudioSolution(SolutionFile solution) { _solution = solution; _app = new VisualStudioApp(); Project = _app.OpenProject(solution.Filename); ThreadHelper.Generic.Invoke(Keyboard.Reset); SolutionExplorer = _app.OpenSolutionExplorer(); SelectSolutionNode(); }
/// <summary> /// Selects the solution node using the mouse. /// /// This is used to reset the state of the mouse before a test as some /// tests can cause the mouse to be left in an odd state - the mouse up /// event is delivered to solution explorer, but selecting items later /// doesn't work because the mouse is left in an odd state. If you /// make this method a nop and try and run all of the tests you'll /// see the bad behavior. /// </summary> public void SelectSolutionNode() { // May need to reopen Solution Explorer so we can find a clickable // point. _solutionExplorer = _app.OpenSolutionExplorer(); var item = SolutionExplorer.WaitForItem(SolutionNodeText); SolutionExplorer.CenterInView(item); Mouse.MoveTo(item.GetClickablePoint()); Mouse.Click(MouseButton.Left); }
public VisualStudioInstance(SolutionFile solution, VisualStudioApp app) { _solution = solution; _app = app; Project = _app.OpenProject(solution.Filename); ThreadHelper.JoinableTaskFactory.Run(async() => { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); Keyboard.Reset(); }); _solutionExplorer = _app.OpenSolutionExplorer(); SelectSolutionNode(); }
/// <summary> /// Opens and activates the solution explorer window. /// </summary> public SolutionExplorerTree OpenSolutionExplorer() { _solutionExplorerTreeView = null; Dte.ExecuteCommand("View.SolutionExplorer"); return(SolutionExplorerTreeView); }