InkAnalyzer.GetAlternates 方法 (ContextNodeCollection)
返回一个 AnalysisAlternateCollection,其中包含指定 ContextNodeCollection 中节点的最多前 10 个分析备选项。
命名空间: System.Windows.Ink
程序集: IAWinFX(在 IAWinFX.dll 中)
语法
声明
Public Function GetAlternates ( _
nodes As ContextNodeCollection _
) As AnalysisAlternateCollection
用法
Dim instance As InkAnalyzer
Dim nodes As ContextNodeCollection
Dim returnValue As AnalysisAlternateCollection
returnValue = instance.GetAlternates(nodes)
public AnalysisAlternateCollection GetAlternates(
ContextNodeCollection nodes
)
public:
AnalysisAlternateCollection^ GetAlternates(
ContextNodeCollection^ nodes
)
public AnalysisAlternateCollection GetAlternates(
ContextNodeCollection nodes
)
public function GetAlternates(
nodes : ContextNodeCollection
) : AnalysisAlternateCollection
参数
返回值
类型:System.Windows.Ink.AnalysisAlternateCollection
nodes 的最多前 10 个分析备选项。
备注
最佳备选项作为集合的第一个备选项返回。如果备选项多于 10 个,则只返回前 10 个。
nodes 中的 ContextNode 对象不一定表示文档的相邻区域。
对于 nodes 中的每个分析提示,InkAnalyzer 仅返回最佳备选项。
示例
此示例获取与 InkAnalyzer (theInkAnalyzer) 关联的 ContextNodeCollection(名为 theContextNodes)的前 10 个备选项。然后将这些备选项的已识别字符串添加到名为 theAlternateStrings 的 StringCollection 中。
' Get analysis alternates for the context node collection and add the
' recognized strings to a string collection.
theAlternateCollection = Me.theInkAnalyzer.GetAlternates(theContextNodes)
theAlternateStrings.Clear()
For Each theAlternate As AnalysisAlternate In theAlternateCollection
theAlternateStrings.Add(theAlternate.RecognizedString)
Next theAlternate
// Get analysis alternates for the context node collection and add the
// recognized strings to a string collection.
theAlternateCollection = this.theInkAnalyzer.GetAlternates(theContextNodes);
theAlternateStrings.Clear();
foreach (AnalysisAlternate theAlternate
in theAlternateCollection)
{
theAlternateStrings.Add(theAlternate.RecognizedString);
}
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求。
版本信息
.NET Framework
受以下版本支持:3.0
另请参见
参考
System.Windows.Ink.AnalysisAlternate
System.Windows.Ink.AnalysisAlternateCollection