ProjectItem.Kind 属性
获取指示对象种类或类型的 GUID 字符串。
命名空间: EnvDTE
程序集: EnvDTE(在 EnvDTE.dll 中)
语法
声明
ReadOnly Property Kind As String
string Kind { get; }
property String^ Kind {
String^ get ();
}
abstract Kind : string with get
function get Kind () : String
属性值
类型:String
表示对象类型的 GUID 字符串。返回的值应转换为适当的Guid或平台等效类型,然后再干使用本机 GUID 数据类型的比较。这样可确保不同项目系统和客户端间的 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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。