共用方式為


Projects 介面

代表指定類型的所有專案。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
<GuidAttribute("E3EC0ADD-31B3-461F-8303-8A5E6931257A")> _
Public Interface Projects _
    Inherits IEnumerable
[GuidAttribute("E3EC0ADD-31B3-461F-8303-8A5E6931257A")]
public interface Projects : IEnumerable
[GuidAttribute(L"E3EC0ADD-31B3-461F-8303-8A5E6931257A")]
public interface class Projects : IEnumerable
[<GuidAttribute("E3EC0ADD-31B3-461F-8303-8A5E6931257A")>]
type Projects =  
    interface
        interface IEnumerable
    end
public interface Projects extends IEnumerable

Projects 型別會公開下列成員。

屬性

  名稱 說明
公用屬性 Count 取得值,指出 Projects 集合中物件的數目。
公用屬性 DTE 取得最上層的擴充性物件。
公用屬性 Kind 取得 GUID 字串,指出物件的種類或型別。
公用屬性 Parent 取得 Projects 集合的直接上層父物件。
公用屬性 Properties 取得與 Projects 集合有關的所有屬性集合。

回頁首

方法

  名稱 說明
公用方法 GetEnumerator() 傳回會逐一查看集合的列舉程式。 (繼承自 IEnumerable)。
公用方法 GetEnumerator() 取得集合中項目的列舉值。
公用方法 Item 傳回 Projects 集合的索引成員。

回頁首

備註

Projects 集合代表整合式開發環境 (IDE) 目前的執行個體中,同一類型的所有專案。 這個集合通常是晚期繫結至 DTE 物件。

範例

Sub ProjectsExample()
    ' Before running, be sure you have one or more projects
    ' loaded in the solution.
    Dim prj As Project
    Dim prjs As Projects
    Dim msg As String

    ' Go through all of the projects in the solution and display
    ' their names and types.
    prjs = DTE.Solution.Projects
    For Each prj In prjs
        msg += "NAME: " & prj.Name & "TYPE: " & prj.Kind & vbCr
    Next
    MsgBox(msg)
End Sub

請參閱

參考

EnvDTE 命名空間

其他資源

控制專案與方案