共用方式為


Project.Kind 屬性

更新:2007 年 11 月

取得指示物件種類或型別的 GUID 字串。

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

語法

ReadOnly Property Kind As String

Dim instance As Project
Dim value As String

value = instance.Kind
string Kind { get; }
property String^ Kind {
    String^ get ();
}
function get Kind () : String

屬性值

型別:System.String

表示物件型別的 GUID 字串。

備註

環境擴充功能必須提供唯一定義的型別字串。這項資訊應可在每項工具、語言的型別程式庫 (Type-Library) 或文件中取得。

範例

Sub KindExample2(ByVal dte As DTE2)

    ' Before running this example, open a project.

    Dim proj As Project = dte.Solution.Projects.Item(1)
    Dim item As ProjectItem
    Dim msg As String

    For Each item In proj.ProjectItems
        msg &= "    " & item.Name & _
            "  [Kind = " & item.Kind & "]" & vbCrLf
    Next

    MsgBox(proj.Name & "  [Kind = " & proj.Kind & _
        "] has the following project items:" & vbCrLf & vbCrLf & msg)
End Sub
public void KindExample2(DTE2 dte)
{
    // Before running this example, open a project.

    Project proj = dte.Solution.Projects.Item(1);
    string msg = "";

    foreach (ProjectItem item in proj.ProjectItems)
        msg += "    " + item.Name + "  [Kind = " + item.Kind + "]\n";

    MessageBox.Show(proj.Name + "  [Kind = " + proj.Kind + 
        "] has the following project items:\n\n" + msg); 
}

使用權限

請參閱

參考

Project 介面

Project 成員

EnvDTE 命名空間

其他資源

HOW TO:編譯和執行 Automation 物件模型程式碼範例