ProjectItem.Kind 属性

获取一个指示对象种类或类型的 GUID 字符串。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
ReadOnly Property Kind As String
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 命名空间

其他资源

如何:编译和运行自动化对象模型代码示例