共用方式為


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 物件。

範例

這個範例會呼叫 Helper 方法 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 會接著將所遇到每個節點的相關資訊傳送至偵錯輸出。Helper 方法 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 命名空間