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 命名空间