InkAnalyzer.GetAlternates Method (ContextNodeCollection, Int32)
Returns a AnalysisAlternateCollection that contains up to the specified number of analysis alternates for nodes that are stored in a ContextNodeCollection.
Namespace: System.Windows.Ink
Assembly: IAWinFX (in IAWinFX.dll)
Syntax
'Declaration
Public Function GetAlternates ( _
nodes As ContextNodeCollection, _
maximumAlternates As Integer _
) As AnalysisAlternateCollection
'Usage
Dim instance As InkAnalyzer
Dim nodes As ContextNodeCollection
Dim maximumAlternates As Integer
Dim returnValue As AnalysisAlternateCollection
returnValue = instance.GetAlternates(nodes, _
maximumAlternates)
public AnalysisAlternateCollection GetAlternates(
ContextNodeCollection nodes,
int maximumAlternates
)
public:
AnalysisAlternateCollection^ GetAlternates(
ContextNodeCollection^ nodes,
int maximumAlternates
)
public function GetAlternates(
nodes : ContextNodeCollection,
maximumAlternates : int
) : AnalysisAlternateCollection
Parameters
nodes
Type: System.Windows.Ink.ContextNodeCollectionThe nodes for which analysis alternates are obtained.
maximumAlternates
Type: System.Int32The number of analysis alternates to return.
Return Value
Type: System.Windows.Ink.AnalysisAlternateCollection
Up to maximumAlternates of the top analysis alternates for nodes.
Remarks
The top alternate is returned as the first alternate of the collection.
The ContextNode objects in nodes do not have to represent adjacent areas of the document.
For each analysis hint in nodes, the InkAnalyzer returns only the top alternate.
Examples
This example gets the top five alternates for the ContextNodeCollection, named theContextNodes, associated with an InkAnalyzer named theInkAnalyzer . It then adds recognized strings for the alternates to the StringCollection, named theAlternateStrings.
' Get 5 analysis alternates for the context node collection and add the
' recognized strings to a string collection.
theAlternateCollection = Me.theInkAnalyzer.GetAlternates(theContextNodes, 5)
theAlternateStrings.Clear()
For Each theAlternate As AnalysisAlternate In theAlternateCollection
theAlternateStrings.Add(theAlternate.RecognizedString)
Next theAlternate
// Get 5 analysis alternates for the context node collection and add the
// recognized strings to a string collection.
theAlternateCollection = this.theInkAnalyzer.GetAlternates(theContextNodes, 5);
theAlternateStrings.Clear();
foreach (AnalysisAlternate theAlternate
in theAlternateCollection)
{
theAlternateStrings.Add(theAlternate.RecognizedString);
}
Platforms
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.0
See Also
Reference
System.Windows.Ink.AnalysisAlternate
System.Windows.Ink.AnalysisAlternateCollection