次の方法で共有


InkAnalyzer.RootNode プロパティ

InkAnalyzer のルート ContextNode を取得します。

名前空間 :  Microsoft.Ink
アセンブリ :  Microsoft.Ink.Analysis (Microsoft.Ink.Analysis.dll 内)

構文

'宣言
Public ReadOnly Property RootNode As ContextNode
'使用
Dim instance As InkAnalyzer
Dim value As ContextNode

value = instance.RootNode
public ContextNode RootNode { get; }
public:
property ContextNode^ RootNode {
    ContextNode^ get ();
}
/** @property */
public ContextNode get_RootNode()
public function get RootNode () : ContextNode

プロパティ値

型 : Microsoft.Ink.ContextNode
InkAnalyzer のルート ContextNode

解説

InkAnalyzer は、ContextNode オブジェクトのツリーを保持します。これらのオブジェクトには、分析の入力と分析の結果の両方が含まれています。ストロークが最初に InkAnalyzer に追加されると、InkAnalyzer はそれらを UnclassifiedInkNode に割り当てます。ストロークが分析されると、InkAnalyzer はそれらをツリー内の適切な ContextNode オブジェクトに割り当てます。

この例では、ヘルパ メソッド CheckTreeNodes を呼び出して、現在、InkAnalyzer、theInkAnalyzer によって保持されているすべての ContextNode オブジェクトを確認します。

' Use a helper function to check all the ContextNode objects in
' the analyzer's tree.
CheckTreeNodes(Me.theInkAnalyzer.RootNode)
// Use a helper function to check all the ContextNode objects in
// the analyzer's tree.
CheckTreeNodes(this.theInkAnalyzer.RootNode);

この例では、次に、CheckTreeNodes が検出された各ノードに関する情報をデバッグ出力に送信します。ヘルパ メソッド GetContextNodeTypeName は表示されません。

''' <summary>
''' Checks the specified ContextNode and all of its descendents.
''' </summary>
''' <param name="theContextNode">The node at which to start.</param>
''' <remarks>
''' This method writes the name of the type of each node encountered
''' to the debug output.
''' </remarks>
Private Shared Sub CheckTreeNodes(ByVal theContextNode As Microsoft.Ink.ContextNode)
    ' Check the node...
    System.Diagnostics.Debug.WriteLine(GetContextNodeTypeName(theContextNode.Type))
    System.Diagnostics.Debug.Indent()

    ' Check the child nodes.
    Dim theContextSubnode As Microsoft.Ink.ContextNode
    For Each theContextSubnode In theContextNode.SubNodes
        CheckTreeNodes(theContextSubnode)
    Next theContextSubnode

    System.Diagnostics.Debug.Unindent()

End Sub 'CheckTreeNodes
/// <summary>
/// Checks the specified ContextNode and all of its descendents.
/// </summary>
/// <param name="theContextNode">The node at which to start.</param>
/// <remarks>
/// This method writes the name of the type of each node encountered
/// to the debug output.
/// </remarks>
private static void CheckTreeNodes(Microsoft.Ink.ContextNode theContextNode)
{
    // Check the node...
    System.Diagnostics.Debug.WriteLine(
        GetContextNodeTypeName(theContextNode.Type));
    System.Diagnostics.Debug.Indent();

    // Check the child nodes.
    foreach (Microsoft.Ink.ContextNode theContextSubnode
        in theContextNode.SubNodes)
    {
        CheckTreeNodes(theContextSubnode);
    }

    System.Diagnostics.Debug.Unindent();
}

プラットフォーム

Windows Vista

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

バージョン情報

.NET Framework

サポート対象 : 3.0

参照

参照

InkAnalyzer クラス

InkAnalyzer メンバ

Microsoft.Ink 名前空間