InkAnalyzer.GetStrokeLanguageId, méthode
Mise à jour : November 2007
Retourne l'identificateur de paramètres régionaux du Stroke spécifié.
Espace de noms : Microsoft.Ink
Assembly : Microsoft.Ink.Analysis (dans Microsoft.Ink.Analysis.dll)
Syntaxe
'Déclaration
Public Function GetStrokeLanguageId ( _
stroke As Stroke _
) As Integer
'Utilisation
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
Paramètres
- stroke
Type : Microsoft.Ink.Stroke
Trait pour lequel retourner l'identificateur de paramètres régionaux.
Valeur de retour
Type : System.Int32
Identificateur de paramètres régionaux de stroke.
Notes
Les paramètres régionaux du trait sont définis lorsque vous ajoutez le trait en appelant AddStroke ou AddStrokes. Pour modifier les paramètres régionaux du trait, appelez la méthode InkAnalyzer.SetStrokeLanguageId.
Exemples
Cet exemple définit une méthode, GetLanguagesInNode, qui permet de retourner tous les identificateurs de paramètres régionaux pour les traits d'un 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)));
}
Plateformes
Windows Vista
Le .NET Framework et le .NET Compact Framework ne prennent pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.
Informations de version
.NET Framework
Pris en charge dans : 3.0