次の方法で共有


ContextLinkBase クラス

ContextLink の基本クラス。親子のリレーションシップではない、2 つの ContextNodeBase オブジェクト間のリレーションシップを表します。

名前空間 :  System.Windows.Ink.AnalysisCore
アセンブリ :  IACore (IACore.dll 内)

構文

'宣言
Public Class ContextLinkBase
'使用
Dim instance As ContextLinkBase
public class ContextLinkBase
public ref class ContextLinkBase
public class ContextLinkBase
public class ContextLinkBase

解説

ContextLinkBase オブジェクトによって表されるリレーションシップの例は次のとおりです。

SourceNodeDestinationNode の間のリレーションシップを調べるには、GetPropertyData メソッドを呼び出して SemanticType を取得します。

次の例では、ContextNodeBase ノード selectedNode にリンクされているすべてのノードを検索します。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);
    }

}

次の例は、theInkAnalyzerWithHint という名前の InkAnalyzer のノード ツリーですべての WritingRegionNode オブジェクトを検索します。この例では、Factoid 値が "IS_DATE_FULLDATE" である PropertyGuidsForAnalysisHintsBase にリンクされているノードを、writingRegionsWithFactoids という名前の ContextNodeCollection に配置します。

Dim writingRegionsWithFactoids As _
    New ContextNodeBaseCollection(Me.theInkAnalyzerWithHint)
Dim allWritingRegions As ContextNodeBaseCollection = _
    Me.theInkAnalyzerWithHint.FindNodesOfType( _
        ContextNodeTypeBase.WritingRegion)
Dim writingRegion As ContextNodeBase
For Each writingRegion In allWritingRegions
    ' See if they are linked to any factoid
    Dim link As ContextLinkBase
    For Each link In writingRegion.Links
        If link.SourceNode.Type = ContextNodeType.AnalysisHint And _
           link.SourceNode.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.Factoid) Then

            If CType(link.SourceNode.GetPropertyData(PropertyGuidsForAnalysisHintsBase.Factoid), String) _
                = "IS_DATE_FULLDATE" Then

                writingRegionsWithFactoids.Add(writingRegion)
            End If
        End If
    Next link
Next writingRegion
ContextNodeBaseCollection writingRegionsWithFactoids = 
    new ContextNodeBaseCollection(this.theInkAnalyzerBaseWithHint);
ContextNodeBaseCollection allWritingRegions =
    this.theInkAnalyzerBaseWithHint.FindNodesOfType(
        System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.WritingRegion);
foreach (ContextNodeBase writingRegion in allWritingRegions)
{
    // See if they are linked to any factoid
    foreach (ContextLinkBase link in writingRegion.Links)
    {
        if (link.SourceNode.Type == ContextNodeTypeBase.AnalysisHint &&
            link.SourceNode.ContainsPropertyData(PropertyGuidsForAnalysisHintsBase.Factoid))
        {
            if ((string) link.SourceNode.GetPropertyData(PropertyGuidsForAnalysisHintsBase.Factoid)
                == "IS_DATE_FULLDATE")
            {
                writingRegionsWithFactoids.Add(writingRegion);
            }
        }
    }
}

継承階層

System.Object
  System.Windows.Ink.AnalysisCore.ContextLinkBase

スレッド セーフ

この型のすべてのパブリック static (Visual Basic では Shared) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

ContextLinkBase メンバ

System.Windows.Ink.AnalysisCore 名前空間

ContextNodeBase.Links