ContextNode.Links 属性

获取表示与其他 ContextNode 对象之间的关系的 ContextLink 对象的集合。

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

语法

声明
Public ReadOnly Property Links As ContextLinkCollection
用法
Dim instance As ContextNode
Dim value As ContextLinkCollection

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

属性值

类型:System.Windows.Ink.ContextLinkCollection
用于表示与其他 ContextNode 对象之间的关系的 ContextLink 对象的集合。

备注

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

示例

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

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

' Find all the nodes that link to the currently selected node.
Dim link As ContextLink
For Each link 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 link
ArrayList destinationNodes = new ArrayList();
ArrayList sourceNodes = new ArrayList();

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

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

平台

Windows Vista

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

ContextNode 类

ContextNode 成员

System.Windows.Ink 命名空间

System.Windows.Ink.ContextLink