Condividi tramite


Metodo InkAnalyzer.AddStrokes (Strokes, Int32)

Aggiornamento: novembre 2007

Aggiunge un insieme di tratti all'oggetto InkAnalyzer e assegna a ogni tratto un identificatore delle impostazioni locali specifico.

Spazio dei nomi:  Microsoft.Ink
Assembly:  Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)

Sintassi

'Dichiarazione
Public Function AddStrokes ( _
    strokesToAdd As Strokes, _
    languageId As Integer _
) As ContextNode
'Utilizzo
Dim instance As InkAnalyzer
Dim strokesToAdd As Strokes
Dim languageId As Integer
Dim returnValue As ContextNode

returnValue = instance.AddStrokes(strokesToAdd, _
    languageId)
public ContextNode AddStrokes(
    Strokes strokesToAdd,
    int languageId
)
public:
ContextNode^ AddStrokes(
    Strokes^ strokesToAdd, 
    int languageId
)
public ContextNode AddStrokes(
    Strokes strokesToAdd,
    int languageId
)
public function AddStrokes(
    strokesToAdd : Strokes, 
    languageId : int
) : ContextNode

Parametri

  • languageId
    Tipo: System.Int32
    Identificatore di lingua da associare ai tratti nell'insieme strokesToAdd.

Valore restituito

Tipo: Microsoft.Ink.ContextNode
Oggetto ContextNode a cui è stato aggiunto l'oggetto strokesToAdd.

Note

L'oggetto InkAnalyzer aggiunge l'oggetto Strokes a un oggetto UnclassifiedInkNode nell'insieme SubNodes della proprietà RootNode. A ogni tratto dell'insieme Strokes, strokesToAdd viene assegnato l'identificatore delle impostazioni locali languageId e viene aggiunto al primo oggetto UnclassifiedInkNode contenente i tratti con lo stesso identificatore delle impostazioni locali. Se non esiste alcun oggetto UnclassifiedInkNode, viene creato un nuovo oggetto UnclassifiedInkNode e strokeToAdd viene aggiunto al nuovo oggetto UnclassifiedInkNode.

Questo metodo espande l'oggetto DirtyRegion all'unione del valore corrente dell'area e del riquadro dei tratti aggiunti.

Se un tratto è già associato all'oggetto InkAnalyzer, l'oggetto InkAnalyzer genera un'eccezione.

Esempi

In questo esempio vengono eseguite le operazioni seguenti.

  • Inizializza un nuovo oggetto Microsoft.Ink.Ink, theInk.

  • Associa un gestore eventi Ink.InkAdded, theInk_InkAdded2 all'oggetto theInk.

  • Inizializza un nuovo oggetto InkAnalyzer, theInkAnalyzer che può analizzare i dati del tratto di theInk.

' Create the Ink for use with the InkCollector and attach
' event handlers.
Me.theInk = New Microsoft.Ink.Ink()
AddHandler Me.theInk.InkAdded, AddressOf theInk_InkAdded

' Create the InkAnalyzer.
Me.theInkAnalyzer = New Microsoft.Ink.InkAnalyzer(Me.theInk, Me)
// Create the Ink for use with the InkCollector and attach
// event handlers.
this.theInk = new Microsoft.Ink.Ink();
this.theInk.InkAdded +=
    new Microsoft.Ink.StrokesEventHandler(theInk_InkAdded);

// Create the InkAnalyzer.
this.theInkAnalyzer =
    new Microsoft.Ink.InkAnalyzer(this.theInk, this);

In questo esempio, il gestore eventi theInk_InkAdded2 accetta i tratti che sono stati aggiunti all'oggetto theInk, li aggiunge all'oggetto theInkAnalyzer e gli assegna un identificatore delle impostazioni locali theLanguageId specifico.

''' <summary>
''' The ink's InkAdded event handler.
''' </summary>
''' <param name="sender">The source of the event.</param>
''' <param name="e">The event data.</param>
Sub theInk_InkAdded2( _
    ByVal sender As Object, ByVal e As Microsoft.Ink.StrokesEventArgs)

    ' This event handler is attached to an Ink object.
    Dim theInk As Microsoft.Ink.Ink = DirectCast(sender, Microsoft.Ink.Ink)

    ' Add the new strokes to the InkAnalyzer using a specific language identifier.
    Me.theInkAnalyzer.AddStrokes( _
        theInk.CreateStrokes(e.StrokeIds), Me.theLanguageId)
End Sub 'theInk_InkAdded2
/// <summary>
/// The ink's InkAdded event handler.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The event data.</param>
void theInk_InkAdded2(object sender, Microsoft.Ink.StrokesEventArgs e)
{
    // This event handler is attached to an Ink object.
    Microsoft.Ink.Ink theInk = sender as Microsoft.Ink.Ink;

    // Add the new strokes to the InkAnalyzer using a specific
    // language identifier.
    this.theInkAnalyzer.AddStrokes(
        theInk.CreateStrokes(e.StrokeIds), this.theLanguageId);
}

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

Vedere anche

Riferimenti

InkAnalyzer Classe

Membri InkAnalyzer

Overload AddStrokes

Spazio dei nomi Microsoft.Ink

InkAnalyzer.AddStroke

InkAnalyzer.RemoveStroke

InkAnalyzer.RemoveStrokes