다음을 통해 공유


VSProject 인터페이스

Visual Basic 프로젝트나 C# 프로젝트에 관련된 정보를 포함합니다. Visual Basic, Visual C# 또는 Visual J# 프로젝트의 경우 Object 개체에서 이 개체가 반환됩니다.

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

구문

‘선언
<GuidAttribute("2CFB826F-F6BF-480D-A546-95A0381CC411")> _
Public Interface VSProject
‘사용 방법
Dim instance As VSProject
[GuidAttribute("2CFB826F-F6BF-480D-A546-95A0381CC411")] 
public interface VSProject
[GuidAttribute(L"2CFB826F-F6BF-480D-A546-95A0381CC411")] 
public interface class VSProject
/** @attribute GuidAttribute("2CFB826F-F6BF-480D-A546-95A0381CC411") */ 
public interface VSProject
GuidAttribute("2CFB826F-F6BF-480D-A546-95A0381CC411") 
public interface VSProject

설명

Project는 모든 언어의 프로젝트에 대한 정보를 포함할 수 있는 핵심 확장성 개체입니다. Project 개체의 Object는 사용된 프로젝트 언어에 따라 형식이 달라지는 개체를 반환합니다. Visual Basic, Visual C# 및 Visual J#의 경우 이러한 개체는 VSProject 개체입니다.

ObjectObject 데이터 형식을 반환합니다. Object에서 반환된 데이터 개체는 명시적으로 VSProject로 변환될 수 있습니다. 아래 예제에서는 CType 함수를 사용하여 변환하는 방법을 보여 줍니다. PrjKind는 변환하기 전에 프로젝트의 형식을 테스트하는 데 사용됩니다.

예제

' Macro Editor
' This example retrieves the VSProject object if the first project
' the solution is a Visual Basic or C# project. This routine assumes
' that the solution contains at least one project.
Imports VSLangProj
Sub VSProjectExample()
   Dim aProject As Project
   Dim aVSProject As VSProject
        
   aProject = DTE.Solution.Projects.Item(1)
   If (aProject.Kind = PrjKind.prjKindVBProject) _
   Or (aProject.Kind = PrjKind.prjKindCSharpProject) Then
      aVSProject = CType(DTE.Solution.Projects.Item(1).Object, VSProject)
      MsgBox(aVSProject.Project.FullName)
   Else
      MsgBox("The first project is not a Visual Basic or C# project.")
   End If
End Sub

참고 항목

참조

VSProject 멤버
VSLangProj 네임스페이스