SolutionExplorer_OutOfProc.cs 3.4 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
            _inProc = CreateInProcComponent<SolutionExplorer_InProc>(visualStudioInstance);
15 16
        }

17 18
        public void CloseSolution(bool saveFirst = false)
            => _inProc.CloseSolution(saveFirst);
19 20 21 22

        /// <summary>
        /// Creates and loads a new solution in the host process, optionally saving the existing solution if one exists.
        /// </summary>
23 24
        public void CreateSolution(string solutionName, bool saveExistingSolutionIfExists = false)
            => _inProc.CreateSolution(solutionName, saveExistingSolutionIfExists);
25

26 27
        public void OpenSolution(string path, bool saveExistingSolutionIfExists = false)
            => _inProc.OpenSolution(path, saveExistingSolutionIfExists);
28

29 30
        public void AddProject(string projectName, string projectTemplate, string languageName)
            => _inProc.AddProject(projectName, projectTemplate, languageName);
31

32 33
        public void CleanUpOpenSolution()
            => _inProc.CleanUpOpenSolution();
M
Matt Warren 已提交
34

35 36
        public int ErrorListErrorCount
            => _inProc.GetErrorListErrorCount();
M
Matt Warren 已提交
37

38 39
        public void AddFile(string projectName, string fileName, string contents = null, bool open = false)
            => _inProc.AddFile(projectName, fileName, contents, open);
M
Matt Warren 已提交
40

41 42
        public void SetFileContents(string projectName, string fileName, string contents)
            => _inProc.SetFileContents(projectName, fileName, contents);
M
Matt Warren 已提交
43

44 45
        public string GetFileContents(string projectName, string fileName)
            => _inProc.GetFileContents(projectName, fileName);
M
Matt Warren 已提交
46

J
Jonathon Marolf 已提交
47
        public void BuildSolution(bool waitForBuildToFinish)
48
            => _inProc.BuildSolution(waitForBuildToFinish);
M
Matt Warren 已提交
49

J
Jonathon Marolf 已提交
50 51 52
        public void OpenFileWithDesigner(string projectName, string fileName)
            => _inProc.OpenFileWithDesigner(projectName, fileName);

53 54
        public void OpenFile(string projectName, string fileName)
            => _inProc.OpenFile(projectName, fileName);
M
Matt Warren 已提交
55

J
Jonathon Marolf 已提交
56 57 58 59 60 61
        public void CloseFile(string projectName, string fileName, bool saveFile)
            => _inProc.CloseFile(projectName, fileName, saveFile);

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

62 63
        public void ReloadProject(string projectName)
            => _inProc.ReloadProject(projectName);
M
Matt Warren 已提交
64

65 66
        public void RestoreNuGetPackages()
            => _inProc.RestoreNuGetPackages();
M
Matt Warren 已提交
67

68 69
        public void SaveAll()
            => _inProc.SaveAll();
M
Matt Warren 已提交
70

71 72
        public void ShowErrorList()
            => _inProc.ShowErrorList();
M
Matt Warren 已提交
73

74 75
        public void ShowOutputWindow()
            => _inProc.ShowOutputWindow();
M
Matt Warren 已提交
76

77 78
        public void UnloadProject(string projectName)
            => _inProc.UnloadProject(projectName);
M
Matt Warren 已提交
79

80 81
        public void WaitForNoErrorsInErrorList()
            => _inProc.WaitForNoErrorsInErrorList();
82 83
    }
}