Metodo InkAnalyzer.GetStrokeType
Aggiornamento: novembre 2007
Restituisce il tipo di un oggetto Stroke.
Spazio dei nomi: Microsoft.Ink
Assembly: Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)
Sintassi
'Dichiarazione
Public Function GetStrokeType ( _
stroke As Stroke _
) As StrokeType
'Utilizzo
Dim instance As InkAnalyzer
Dim stroke As Stroke
Dim returnValue As StrokeType
returnValue = instance.GetStrokeType(stroke)
public StrokeType GetStrokeType(
Stroke stroke
)
public:
StrokeType GetStrokeType(
Stroke^ stroke
)
public StrokeType GetStrokeType(
Stroke stroke
)
public function GetStrokeType(
stroke : Stroke
) : StrokeType
Parametri
- stroke
Tipo: Microsoft.Ink.Stroke
Tratto per il quale restituire la classificazione.
Valore restituito
Tipo: Microsoft.Ink.StrokeType
Classificazione dell'oggetto stroke.
Note
Se il tipo del tratto è costituito dal valore Unspecified di Microsoft.Ink.StrokeType, l'oggetto InkAnalyzer classifica il tratto durante l'analisi dell'input penna. In caso contrario, InkAnalyzer utilizza il tipo impostato sul tratto.
Per specificare o modificare il tipo di tratto, utilizzare InkAnalyzer.SetStrokeType o InkAnalyzer.SetStrokesType.
Esempi
In questo esempio viene definito un metodo, GetStrokeTypesInNode, per la restituzione di tutti i tipi di tratti in 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 GetStrokeTypesInNode( _
ByVal theInkAnalyzer As Microsoft.Ink.InkAnalyzer, _
ByVal theContextNode As Microsoft.Ink.ContextNode) _
As Microsoft.Ink.StrokeType()
' Iterate through the strokes within the context node and add the
' stroke types to a collection.
Dim theLanguages As New System.Collections.ArrayList()
Dim theStroke As Microsoft.Ink.Stroke
For Each theStroke In theContextNode.Strokes
Dim theStrokeType As Microsoft.Ink.StrokeType = _
theInkAnalyzer.GetStrokeType(theStroke)
If Not theLanguages.Contains(theStrokeType) Then
theLanguages.Add(theStrokeType)
End If
Next theStroke
' Return the elements of the collection as an array.
Return CType(theLanguages.ToArray(GetType(Microsoft.Ink.StrokeType)), _
Microsoft.Ink.StrokeType())
End Function 'GetStrokeTypesInNode
/// <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 Microsoft.Ink.StrokeType[] GetStrokeTypesInNode(
Microsoft.Ink.InkAnalyzer theInkAnalyzer,
Microsoft.Ink.ContextNode theContextNode)
{
// Iterate through the strokes within the context node and add the
// stroke types to a collection.
System.Collections.ArrayList theLanguages =
new System.Collections.ArrayList();
foreach (Microsoft.Ink.Stroke theStroke in theContextNode.Strokes)
{
Microsoft.Ink.StrokeType theStrokeType =
theInkAnalyzer.GetStrokeType(theStroke);
if (!theLanguages.Contains(theStrokeType))
{
theLanguages.Add(theStrokeType);
}
}
// Return the elements of the collection as an array.
return (Microsoft.Ink.StrokeType[])
(theLanguages.ToArray(typeof(Microsoft.Ink.StrokeType)));
}
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