ContextNodeBase.Links 属性

获取表示其他 ContextNodeBase 对象之间的关系的 ContextLinkBase 对象的集合。

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

语法

声明
Public ReadOnly Property Links As ContextLinkBaseCollection
用法
Dim instance As ContextNodeBase
Dim value As ContextLinkBaseCollection

value = instance.Links
public ContextLinkBaseCollection Links { get; }
public:
property ContextLinkBaseCollection^ Links {
    ContextLinkBaseCollection^ get ();
}
/** @property */
public ContextLinkBaseCollection get_Links()
public function get Links () : ContextLinkBaseCollection

属性值

类型:System.Windows.Ink.AnalysisCore.ContextLinkBaseCollection
表示其他 ContextNodeBase 对象之间的关系的 ContextLinkBase 对象的集合。

备注

有关链接所描述的关系种类的更多信息,请参见 ContextLinkBase 类。

示例

下面的示例查找链接到名为 selectedNode 的 ContextNodeBase 节点的所有节点。如果 selectedNode 不是目标节点,则将目标节点添加到名为 destinationNodes 的 ArrayList 中。如果 selectedNode 不是源节点,则将该节点添加到名为 sourceNodes 的 ArrayList 中。

Dim destinationNodes As ArrayList = New ArrayList()
Dim sourceNodes As ArrayList = New ArrayList()

' Find all the nodes that link to the currently selected node.
For Each link As Microsoft.Ink.ContextLink In selectedNode.Links
    If link.DestinationNode <> selectedNode Then
        destinationNodes.Add(link.DestinationNode)
    End If

    If link.SourceNode <> selectedNode Then
        sourceNodes.Add(link.SourceNode)
    End If
Next
ArrayList destinationNodes = new ArrayList();
ArrayList sourceNodes = new ArrayList();

// Find all the nodes that link to the currently selected node.
foreach (Microsoft.Ink.ContextLink link in selectedNode.Links)
{
    if (link.DestinationNode != selectedNode)
    {
        destinationNodes.Add(link.DestinationNode);
    }

    if (link.SourceNode != selectedNode)
    {
        sourceNodes.Add(link.SourceNode);
    }

}

平台

Windows Vista, Windows XP SP2, Windows Server 2003

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

ContextNodeBase 类

ContextNodeBase 成员

System.Windows.Ink.AnalysisCore 命名空间

System.Windows.Ink.AnalysisCore.ContextLinkBase