Solution2 인터페이스

업데이트: 2007년 11월

IDE(통합 개발 환경)에서 모든 프로젝트 및 솔루션의 전반적인 속성을 나타냅니다.

네임스페이스:  EnvDTE80
어셈블리:  EnvDTE80(EnvDTE80.dll)

구문

<GuidAttribute("FA238614-FBB1-4314-A7F7-49AE8BB6C6BA")> _
Public Interface Solution2 _
    Implements _Solution

Dim instance As Solution2
[GuidAttribute("FA238614-FBB1-4314-A7F7-49AE8BB6C6BA")]
public interface Solution2 : _Solution
[GuidAttribute(L"FA238614-FBB1-4314-A7F7-49AE8BB6C6BA")]
public interface class Solution2 : _Solution
public interface Solution2 extends _Solution

설명

Solution 개체는 IDE의 현재 인스턴스에 속한 모든 프로젝트 및 솔루션 전반의 속성 컬렉션입니다. Solution 개체에는 래핑된 프로젝트, 하위 프로젝트, 최상위 프로젝트 등의 각 프로젝트에 대한 프로젝트 요소가 포함됩니다.

DTE.Solution을 사용하여 이 개체를 참조합니다. MiscFiles 또는 SolutionItems 같은 가상 프로젝트를 참조하려면 Solution.Item(EnvDTE.Constants.vsProjectKindMisc) 또는 Solution.Item(EnvDTE.Constants.vsProjectKindSolutionItems)를 사용하십시오.

예제

이 추가 기능 코드를 실행하는 방법에 대한 내용은 방법: 자동화 개체 모델 코드의 예제 컴파일 및 실행을 참조하십시오.

Public Sub OnConnection(ByVal application As Object, _
 ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
 ByRef custom As Array) Implements IDTExtensibility2.OnConnection
    _applicationObject = CType(application, DTE2)
    _addInInstance = CType(addInInst, AddIn)
    SolutionExample(_applicationObject)
End Sub

Sub SolutionExample(ByVal dte As DTE2)
    ' This function creates a solution and adds a Visual C# Console
    ' project to it.
    Try
        Dim soln As Solution2 = CType(DTE.Solution, Solution2)
        Dim csTemplatePath As String
        ' This path must exist on your computer.
        ' Replace <file path> below with an actual path.
        Dim csPrjPath As String = "<file path>"
        MsgBox("starting")
        ' Get the project template path for a C# console project.
        csTemplatePath = soln.GetProjectTemplate _
        ("ConsoleApplication.zip", "CSharp")
        ' Create a new C# Console project using the template obtained 
        ' above.
        soln.AddFromTemplate(csTemplatePath, csPrjPath, _
        "New CSharp Console Project", False)
        MsgBox("done")
    Catch ex As System.Exception
        MsgBox(ex.ToString)
    End Try
End Sub
using System.Windows.Forms;
public void OnConnection(object application,
 Extensibility.ext_ConnectMode connectMode, object addInInst,
 ref System.Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    // Pass the applicationObject member variable to the code example.
    SolutionExample((DTE2)_applicationObject);
}

public void SolutionExample(DTE2 dte)
{
    // This function creates a solution and adds a Visual C# Console
    // project to it.
    try{
        Solution2 soln = (Solution2)_applicationObject.Solution;
        String csTemplatePath;
        // The file path must exist on your computer.
        // Replace <file path> below with an actual path.
        String csPrjPath = "<file path>";
    "<file path>MessageBox.Show("Starting...");
"<file path>"<file path>csTemplatePath = 
soln.GetProjectTemplate("ConsoleApplication.zip", "CSharp");
        // Create a new C# Console project using the template obtained 
        // above.
        soln.AddFromTemplate(csTemplatePath, csPrjPath,
 "New CSharp Console Project", false);
        MessageBox.Show("Done!");
    }
    catch(SystemException ex)
    {
        MessageBox.Show("ERROR: " + ex);
    }
}

참고 항목

참조

Solution2 멤버

EnvDTE80 네임스페이스