共用方式為


ProjectItem.Kind 屬性

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

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

語法

'宣告
ReadOnly Property Kind As String
    Get
string Kind { get; }
property String^ Kind {
    String^ get ();
}
abstract Kind : string
function get Kind () : String

屬性值

型別:System.String
表示物件型別的 GUID 字串。

備註

如果您要提供新類型的專案項目,您必須提供唯一的 GUID 字串來識別它,然後在工具、型別程式庫或文件中提供這項資訊。

範例

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); 
}

.NET Framework 安全性

請參閱

參考

ProjectItem 介面

EnvDTE 命名空間

其他資源

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