AnalysisHintNode.GetRecognizedString 方法
傳回 InkAnalyzer 已套用目前分析提示之所有書寫節點的串連辨識字串。
命名空間: System.Windows.Ink
組件: IAWinFX (在 IAWinFX.dll 中)
語法
'宣告
Public Function GetRecognizedString As String
'用途
Dim instance As AnalysisHintNode
Dim returnValue As String
returnValue = instance.GetRecognizedString()
public string GetRecognizedString()
public:
String^ GetRecognizedString()
public String GetRecognizedString()
public function GetRecognizedString() : String
傳回值
型別:System.String
InkAnalyzer 已套用目前分析提示之所有書寫節點的串連辨識字串。預設為空字串 ("")。
備註
這個方法所傳回的字串與您要透過串連連結提示之 System.Windows.Ink.ContextNode 物件的辨識字串來取得的字串一樣。已辨識字串的順序就是 InkAnalyzerBaseGetRecognizedString() 中所使用的相同順序。
範例
這個範例會建立 StringBuilder (名為 notes),並加入有關目前附加至 InkAnalyzer (名為 theInkAnalyzerWithHint) 之所有提示的資訊。每個提示的提示名稱、單字清單和已辨識的字串都會加入至 notes。
Dim notes As New System.Text.StringBuilder()
notes.AppendLine("List of all the current AnalysisHintNodes:")
Dim theHint As 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 System.Text.StringBuilder();
notes.AppendLine("List of all the current AnalysisHintNodes:");
foreach (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