Condividi tramite


Metodo InkAnalyzerBase.AddStroke (Int32, array<Int32[], array<Guid[], Int32)

Aggiornamento: novembre 2007

Aggiunge dati relativi a un singolo tratto all'analizzatore dell'input penna e assegna un identificatore delle impostazioni cultura specifico al tratto.

Spazio dei nomi:  System.Windows.Ink.AnalysisCore
Assembly:  IACore (in IACore.dll)

Sintassi

'Dichiarazione
Public Function AddStroke ( _
    strokeId As Integer, _
    strokePacketData As Integer(), _
    strokePacketDescription As Guid(), _
    languageId As Integer _
) As ContextNodeBase
'Utilizzo
Dim instance As InkAnalyzerBase
Dim strokeId As Integer
Dim strokePacketData As Integer()
Dim strokePacketDescription As Guid()
Dim languageId As Integer
Dim returnValue As ContextNodeBase

returnValue = instance.AddStroke(strokeId, _
    strokePacketData, strokePacketDescription, _
    languageId)
public ContextNodeBase AddStroke(
    int strokeId,
    int[] strokePacketData,
    Guid[] strokePacketDescription,
    int languageId
)
public:
ContextNodeBase^ AddStroke(
    int strokeId, 
    array<int>^ strokePacketData, 
    array<Guid>^ strokePacketDescription, 
    int languageId
)
public ContextNodeBase AddStroke(
    int strokeId,
    int[] strokePacketData,
    Guid[] strokePacketDescription,
    int languageId
)
public function AddStroke(
    strokeId : int, 
    strokePacketData : int[], 
    strokePacketDescription : Guid[], 
    languageId : int
) : ContextNodeBase

Parametri

  • strokePacketData
    Tipo: array<System.Int32[]
    Matrice che contiene i dati del pacchetto per il tratto.
  • strokePacketDescription
    Tipo: array<System.Guid[]
    Matrice che contiene gli identificatori di proprietà del pacchetto.
  • languageId
    Tipo: System.Int32
    Identificatore delle impostazioni cultura da assegnare al tratto.

Valore restituito

Tipo: System.Windows.Ink.AnalysisCore.ContextNodeBase
Nodo di contesto al quale l'analizzatore dell'input penna ha aggiunto il tratto.

Note

L'oggetto InkAnalyzerBase aggiunge il tratto a un oggetto ContextNodeBase con un valore della proprietà Type di UnclassifiedInk().

L'analizzatore dell'input penna assegna l'identificatore delle impostazioni cultura specificato al tratto. Successivamente aggiunge il tratto al primo nodo dell'input penna non classificato sotto il nodo radice dell'analizzatore dell'input penna che contiene tratti con lo stesso identificatore delle impostazioni cultura. Se l'analizzatore dell'input penna non è in grado di rilevare un nodo con lo stesso identificatore delle impostazioni cultura, crea un nuovo oggetto ContextNodeBase sotto il nodo radice e aggiunge il tratto al nuovo nodo dell'input penna non classificato.

strokePacketData contiene dati di pacchetto per tutti i punti nel tratto. strokePacketDescription contiene GUID che descrivono i tipi di dati di pacchetto inclusi per ogni punto nel tratto. Per un elenco completo delle proprietà del pacchetto disponibili, vedere la classe PacketProperty.

Questo metodo espande l'oggetto DirtyRegion all'unione del valore corrente dell'area e del riquadro del tratto aggiunto.

Se InkAnalyzerBase contiene già un tratto con lo stesso identificatore, InkAnalyzerBase genera un'eccezione.

Esempi

In questo esempio viene definito un metodo che converte un oggetto Stroke nei dati di pacchetto, aggiunge il tratto a un oggetto InkAnalyzerBase e assegna un'identificatore delle impostazioni locali specifico al tratto. Il metodo restituisce l'oggetto ContextNodeBase al quale l'analizzatore dell'input penna ha aggiunto il tratto.

''' <summary>
''' Adds a stroke to an InkAnalyzerBase and assigns a specific
''' culture identifier to the stroke.
''' </summary>
''' <param name="baseInkAnalyzer">
''' The analyzer that receives the stroke.</param>
''' <param name="theStroke">The stroke to add.</param>
''' <param name="languageIdentifier">The culture identifier to assign to
''' the stroke.</param>
''' <returns>The node to which the analyzer added the stroke.</returns>
''' <remarks>
''' This method converts stroke data to packet data for example only.
''' The InkAnalyzerBase is used when your application is handling packet
''' data. If your application uses stroke data from an Ink object, then
''' you would use InkAnalyzer.
''' </remarks>
Public Overloads Shared Function MyAddStroke( _
ByVal baseInkAnalyzer As System.Windows.Ink.AnalysisCore.InkAnalyzerBase, _
ByVal theStroke As Microsoft.Ink.Stroke, _
ByVal languageIdentifier As Integer) _
As System.Windows.Ink.AnalysisCore.ContextNodeBase
    If baseInkAnalyzer Is Nothing Then
        Throw New ArgumentNullException("baseInkAnalyzer")
    End If

    If theStroke Is Nothing Then
        Throw New ArgumentNullException("theStroke")
    End If

    ' Add a single stroke to the InkAnalyzerBase and specify the
    ' stroke's language.
    Dim result As System.Windows.Ink.AnalysisCore.ContextNodeBase = _
        baseInkAnalyzer.AddStroke(theStroke.Id, _
            theStroke.GetPacketData(), theStroke.PacketDescription, _
            languageIdentifier)

    Return result
End Function 'AddStroke
/// <summary>
/// Adds a stroke to an InkAnalyzerBase and assigns a specific
/// culture identifier to the stroke.
/// </summary>
/// <param name="baseInkAnalyzer">
/// The analyzer that receives the stroke.</param>
/// <param name="theStroke">The stroke to add.</param>
/// <param name="languageIdentifier">The culture identifier to assign to
/// the stroke.</param>
/// <returns>The node to which the analyzer added the stroke.</returns>
/// <remarks>
/// This method converts stroke data to packet data for example only.
/// The InkAnalyzerBase is used when your application is handling packet
/// data. If your application uses stroke data from an Ink object, then
/// you would use InkAnalyzer.
/// </remarks>
public static System.Windows.Ink.AnalysisCore.ContextNodeBase MyAddStroke(
System.Windows.Ink.AnalysisCore.InkAnalyzerBase baseInkAnalyzer,
    Microsoft.Ink.Stroke theStroke,
    int languageIdentifier)
{
    if (null == baseInkAnalyzer)
    {
        throw new ArgumentNullException("baseInkAnalyzer");
    }

    if (null == theStroke)
    {
        throw new ArgumentNullException("theStroke");
    }

    // Add a single stroke to the InkAnalyzerBase and specify the
    // stroke's language.
    System.Windows.Ink.AnalysisCore.ContextNodeBase result = baseInkAnalyzer.AddStroke(
        theStroke.Id, theStroke.GetPacketData(),
        theStroke.PacketDescription, languageIdentifier);

    return result;
}

Piattaforme

Windows Vista, Windows XP SP2, Windows Server 2003

.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

Vedere anche

Riferimenti

InkAnalyzerBase Classe

Membri InkAnalyzerBase

Overload AddStroke

Spazio dei nomi System.Windows.Ink.AnalysisCore

InkAnalyzerBase.AddStrokes

InkAnalyzerBase.RemoveStroke

InkAnalyzerBase.RemoveStrokes