ContextNodeBaseCollection.IndexOf 方法 (Guid)

使用节点的标识符返回特定 ContextNodeBase 对象在 ContextNodeBaseCollection 中的索引。

命名空间:  System.Windows.Ink.AnalysisCore
程序集:  IACore(在 IACore.dll 中)

语法

声明
Public Function IndexOf ( _
    nodeId As Guid _
) As Integer
用法
Dim instance As ContextNodeBaseCollection
Dim nodeId As Guid
Dim returnValue As Integer

returnValue = instance.IndexOf(nodeId)
public int IndexOf(
    Guid nodeId
)
public:
int IndexOf(
    Guid nodeId
)
public int IndexOf(
    Guid nodeId
)
public function IndexOf(
    nodeId : Guid
) : int

参数

返回值

类型:System.Int32
特定 ContextNodeBase 对象在 ContextNodeBaseCollection 中的索引。

备注

如果传入 Guid,但 ContextNodeBaseCollection 中不存在具有该标识符的 ContextNodeBase 对象,则此方法返回 -1。

示例

下面的示例演示如何查找名为 nodes 的 ContextNodeBaseCollection 中可能包含的特定 ContextNodeBase (myNode) 的索引。

Dim myNodePosition As Integer = nodes.IndexOf(myNode.Id)
            int myNodePosition = nodes.IndexOf(myNode.Id);

平台

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

ContextNodeBaseCollection 类

ContextNodeBaseCollection 成员

IndexOf 重载

System.Windows.Ink.AnalysisCore 命名空间