Metodo InkAnalyzer.GetStrokeLanguageId
Aggiornamento: novembre 2007
Restituisce l'identificatore delle impostazioni locali dell'oggetto Stroke specificato.
Spazio dei nomi: Microsoft.Ink
Assembly: Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)
Sintassi
'Dichiarazione
Public Function GetStrokeLanguageId ( _
stroke As Stroke _
) As Integer
'Utilizzo
Dim instance As InkAnalyzer
Dim stroke As Stroke
Dim returnValue As Integer
returnValue = instance.GetStrokeLanguageId(stroke)
public int GetStrokeLanguageId(
Stroke stroke
)
public:
int GetStrokeLanguageId(
Stroke^ stroke
)
public int GetStrokeLanguageId(
Stroke stroke
)
public function GetStrokeLanguageId(
stroke : Stroke
) : int
Parametri
- stroke
Tipo: Microsoft.Ink.Stroke
Tratto per il quale restituire l'identificatore delle impostazioni locali.
Valore restituito
Tipo: System.Int32
Identificatore delle impostazioni locali di stroke.
Note
Le impostazioni locali del tratto vengono impostate quando si aggiunge il tratto tramite la chiamata del metodo AddStroke o AddStrokes. Per modificare le impostazioni locali del tratto, chiamare il metodo InkAnalyzer.SetStrokeLanguageId.
Esempi
In questo esempio viene definito un metodo, GetLanguagesInNode, per restituire tutti gli identificatori delle impostazioni locali per i tratti di un oggetto ContextNode.
''' <summary>
''' Returns the locale identifiers for all the strokes in the node.
''' </summary>
''' <param name="theInkAnalyzer">The ink analyzer containing the node.</param>
''' <param name="theContextNode">The node to check.</param>
''' <returns>An array of unique locale identifiers.</returns>
Private Function GetLanguagesInNode( _
ByVal theInkAnalyzer As Microsoft.Ink.InkAnalyzer, _
ByVal theContextNode As Microsoft.Ink.ContextNode) As Integer()
' Iterate through the strokes within the context node and add the locale
' identifiers to a collection.
Dim theLanguages As New System.Collections.ArrayList()
Dim theStroke As Microsoft.Ink.Stroke
For Each theStroke In theContextNode.Strokes
Dim theStrokeLanguage As Integer = _
theInkAnalyzer.GetStrokeLanguageId(theStroke)
If Not theLanguages.Contains(theStrokeLanguage) Then
theLanguages.Add(theStrokeLanguage)
End If
Next theStroke
' Return the elements of the collection as an array.
Return CType(theLanguages.ToArray(GetType(Integer)), Integer())
End Function 'GetLanguagesInNode
/// <summary>
/// Returns the locale identifiers for all the strokes in the node.
/// </summary>
/// <param name="theInkAnalyzer">The ink analyzer containing the node.</param>
/// <param name="theContextNode">The node to check.</param>
/// <returns>An array of unique locale identifiers.</returns>
private int[] GetLanguagesInNode(
Microsoft.Ink.InkAnalyzer theInkAnalyzer,
Microsoft.Ink.ContextNode theContextNode)
{
// Iterate through the strokes within the context node and add the locale
// identifiers to a collection.
System.Collections.ArrayList theLanguages =
new System.Collections.ArrayList();
foreach (Microsoft.Ink.Stroke theStroke in theContextNode.Strokes)
{
int theStrokeLanguage =
theInkAnalyzer.GetStrokeLanguageId(theStroke);
if (!theLanguages.Contains(theStrokeLanguage))
{
theLanguages.Add(theStrokeLanguage);
}
}
// Return the elements of the collection as an array.
return (int[])(theLanguages.ToArray(typeof(int)));
}
Piattaforme
Windows Vista
.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.
Informazioni sulla versione
.NET Framework
Supportato in: 3.0