SolutionExplorer_OutOfProc.cs 2.9 KB
Newer Older
1 2
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

3
using Microsoft.VisualStudio.IntegrationTest.Utilities.InProcess;
4

5
namespace Microsoft.VisualStudio.IntegrationTest.Utilities.OutOfProcess
6
{
7
    public class SolutionExplorer_OutOfProc : OutOfProcComponent
8
    {
9 10
        private readonly SolutionExplorer_InProc _inProc;

11 12 13
        public SolutionExplorer_OutOfProc(VisualStudioInstance visualStudioInstance)
            : base(visualStudioInstance)
        {
14
            this._inProc = CreateInProcComponent<SolutionExplorer_InProc>(visualStudioInstance);
15 16
        }

17 18 19 20
        public void CloseSolution(bool saveFirst = false)
        {
            _inProc.CloseSolution(saveFirst);
        }
21 22 23 24 25 26

        /// <summary>
        /// Creates and loads a new solution in the host process, optionally saving the existing solution if one exists.
        /// </summary>
        public void CreateSolution(string solutionName, bool saveExistingSolutionIfExists = false)
        {
27
            _inProc.CreateSolution(solutionName, saveExistingSolutionIfExists);
28 29 30 31
        }

        public void OpenSolution(string path, bool saveExistingSolutionIfExists = false)
        {
32
            _inProc.OpenSolution(path, saveExistingSolutionIfExists);
33 34 35 36
        }

        public void AddProject(string projectName, string projectTemplate, string languageName)
        {
37
            _inProc.AddProject(projectName, projectTemplate, languageName);
38 39 40 41
        }

        public void CleanUpOpenSolution()
        {
42
            _inProc.CleanUpOpenSolution();
43
        }
M
Matt Warren 已提交
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

        public int ErrorListErrorCount => _inProc.GetErrorListErrorCount();

        public void AddFile(string projectName, string fileName, string contents = null, bool open = false) => _inProc.AddFile(projectName, fileName, contents, open);

        public void SetFileContents(string projectName, string fileName, string contents) => _inProc.SetFileContents(projectName, fileName, contents);

        public string GetFileContents(string projectName, string fileName) => _inProc.GetFileContents(projectName, fileName);

        public void BuildSolution(bool waitForBuildToFinish = false) => _inProc.BuildSolution(waitForBuildToFinish);

        public void OpenFile(string projectName, string fileName) => _inProc.OpenFile(projectName, fileName);

        public void ReloadProject(string projectName) => _inProc.ReloadProject(projectName);

        public void RestoreNuGetPackages() => _inProc.RestoreNuGetPackages();

        public void SaveAll() => _inProc.SaveAll();

        public void ShowErrorList() => _inProc.ShowErrorList();

        public void ShowOutputWindow() => _inProc.ShowOutputWindow();

        public void UnloadProject(string projectName) => _inProc.UnloadProject(projectName);

        public void WaitForNoErrorsInErrorList() => _inProc.WaitForNoErrorsInErrorList();
70 71
    }
}