AnalysisHintNode.GetWordlist 方法

返回一个字符串数组,表示此分析提示的单词列表。

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink.Analysis(在 Microsoft.Ink.Analysis.dll 中)

语法

声明
Public Function GetWordlist As String()
用法
Dim instance As AnalysisHintNode
Dim returnValue As String()

returnValue = instance.GetWordlist()
public string[] GetWordlist()
public:
array<String^>^ GetWordlist()
public String[] GetWordlist()
public function GetWordlist() : String[]

返回值

类型:array<System.String[]
一个字符串数组,表示此分析提示的单词列表;如果没有设置单词列表,则为 nullnull 引用(在 Visual Basic 中为 Nothing)。

备注

若要更改提示的单词列表,请使用 SetWordlist

示例

此示例创建 System.Text.StringBuilder (notes),并添加有关 InkAnalyzer (theInkAnalyzerWithHint) 当前所有附加提示的信息。对于每个提示,提示的名称、单词列表和已识别字符串均会添加到 notes。

Dim notes = New System.Text.StringBuilder()
notes.AppendLine("List of all the current AnalysisHintNodes:")

Dim theHint As Microsoft.Ink.AnalysisHintNode
For Each theHint In Me.theInkAnalyzerWithHint.GetAnalysisHints()
    notes.AppendLine(" Hint Name: " + theHint.Name)

    If 0 < theHint.GetWordlist().Length Then
        notes.Append(" - WordList: ")
        Dim first As Boolean = True
        Dim theWord As String
        For Each theWord In theHint.GetWordlist()
            If Not first Then
                notes.Append(", ")
            Else
                first = False
            End If
            notes.AppendFormat("'{0}'", theWord)
        Next theWord
        notes.AppendLine()
    Else
        notes.AppendLine(" - No WordList specified")
    End If

    If String.Empty <> theHint.GetRecognizedString() Then
        notes.AppendLine(" - Recognized string: " _
            + theHint.GetRecognizedString())
    Else
        notes.AppendLine(" - No recognized string.")
    End If

    notes.AppendLine()
Next theHint
System.Text.StringBuilder notes = new StringBuilder();
notes.AppendLine("List of all the current AnalysisHintNodes:");

foreach (Microsoft.Ink.AnalysisHintNode theHint
    in this.theInkAnalyzerWithHint.GetAnalysisHints())
{
    notes.AppendLine(" Hint Name: " + theHint.Name);

    if (0 < theHint.GetWordlist().Length)
    {
        notes.Append(" - WordList: ");
        bool first = true;
        foreach (String theWord in theHint.GetWordlist())
        {
            if (!first)
            {
                notes.Append(", ");
            }
            else
            {
                first = false;
            }
            notes.AppendFormat("'{0}'", theWord);
        }
        notes.AppendLine();
    }
    else
    {
        notes.AppendLine(" - No WordList specified");
    }

    if (string.Empty != theHint.GetRecognizedString())
    {
        notes.AppendLine(" - Recognized string: "
            + theHint.GetRecognizedString());
    }
    else
    {
        notes.AppendLine(" - No recognized string.");
    }

    notes.AppendLine();
}

平台

Windows Vista

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

AnalysisHintNode 类

AnalysisHintNode 成员

Microsoft.Ink 命名空间