Condividi tramite


Enumerazione ConfirmationType

Aggiornamento: novembre 2007

Definisce i valori che specificano la conferma del tipo che può verificarsi in un oggetto ContextNodeBase.

Questa enumerazione dispone di un attributo FlagsAttribute che consente una combinazione bit per bit dei valori dei membri.

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

Sintassi

'Dichiarazione
<FlagsAttribute> _
Public Enumeration ConfirmationType
'Utilizzo
Dim instance As ConfirmationType
[FlagsAttribute]
public enum ConfirmationType
[FlagsAttribute]
public enum class ConfirmationType
/** @attribute FlagsAttribute */
public enum ConfirmationType
public enum ConfirmationType

Membri

Nome membro Descrizione
None Specifica che non è applicata alcuna conferma. InkAnalyzer è libero di modificare un nodo di contesto o i relativi discendenti in base alle necessità.
NodeTypeAndProperties Specifica che InkAnalyzer non può modificare il tipo o le proprietà del nodo di contesto specificato.
TopBoundary Specifica che InkAnalyzerBase non eseguirà operazioni, inclusa l'aggiunta di input penna o l'unione con altri oggetti ContextNodeBases che provocano lo spostamento di TopBoundary oltre il limite superiore corrente. Esempio:

Note

È possibile utilizzare NodeTypeAndProperties solo per oggetti ContextNodeBase di tipo InkWord e InkDrawing. In caso contrario, viene generata un'eccezione InvalidOperationException.

Esempi

L'esempio seguente è un gestore dell'evento MouseUp in un oggetto Panel denominato theNotesPanel che raccoglie l'input penna tramite un oggetto InkCollector denominato theInkCollector. L'applicazione presenta un valore Boolean, confirmMode, impostato da un oggetto MenuItem denominato confirmMenuItem. In modalità di "conferma" l'utente fa clic su una parola per confermarla (o per disattivare la conferma se il nodo è già confermato). Nell'esempio viene convertito l'evento MouseUp in coordinate di input penna e vengono utilizzati HitTest e FindNodesOfType per trovare i nodi appropriati. Dopo avere trovato i nodi, viene chiamato Confirm per attivare o disattivare la conferma. Infine, viene disattivata la modalità "di conferma" dell'applicazione.

Private Sub theNotesPanel_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles theNotesPanel.MouseUp
    If Me.confirmMode = True Then
        ' Translate coordinates into ink dimensions
        Dim hitPoint As New Point(e.X, e.Y)
        Dim panelGraphics As Graphics = Me.theNotesPanel.CreateGraphics()
        Me.theInkCollector.Renderer.PixelToInkSpace(panelGraphics, hitPoint)
        panelGraphics.Dispose()

        ' Find the strokes that the user selected
        Dim selectedStrokes As Strokes = Me.theInkCollector.Ink.HitTest(hitPoint, 10)

        ' The integer array must be exactly the right size. Arrays
        ' begin at zero, so the upper bound is selectedStrokes.Count - 1.
        Dim selectedStrokeIds(selectedStrokes.Count - 1) As Integer

        For i As Integer = 0 To selectedStrokes.Count - 1
            selectedStrokeIds(i) = selectedStrokes(i).Id
        Next

        ' Find the ink word nodes that correspond to those strokes
        Dim selectedNodes As ContextNodeBaseCollection = _
            Me.theInkAnalyzerBase.FindNodesOfType(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.InkWord, _
            selectedStrokeIds)

        ' Toggle the confirmation type on these nodes
        Dim selectedNode As ContextNodeBase
        For Each selectedNode In selectedNodes
            If selectedNode.IsConfirmed( _
               Windows.Ink.AnalysisCore.ConfirmationType.NodeTypeAndProperties) Then
                selectedNode.Confirm(System.Windows.Ink.AnalysisCore.ConfirmationType.None)
            Else
                selectedNode.Confirm(System.Windows.Ink.AnalysisCore.ConfirmationType.NodeTypeAndProperties)
            End If
        Next selectedNode

        ' No longer in "confirm" mode
        Me.confirmMode = False
        Me.ConfirmMenuItem.Checked = False
        Me.theInkCollector.Enabled = True
    End If

End Sub
private void theNotesPanel_MouseUp(object sender, MouseEventArgs e)
{
    if (this.confirmMode)
    {
        // Translate coordinates into ink dimensions
        Point hitPoint = new Point(e.X, e.Y);
        Graphics panelGraphics = this.theNotesPanel.CreateGraphics();
        this.theInkCollector.Renderer.PixelToInkSpace(panelGraphics, ref hitPoint);
        panelGraphics.Dispose();

        // Find the strokes that the user selected
        Strokes selectedStrokes = this.theInkCollector.Ink.HitTest(hitPoint, 10);

        int[] selectedStrokeIds = new int[selectedStrokes.Count];

        for (int i = 0; i < selectedStrokes.Count; i++)
        {
            selectedStrokeIds[i] = selectedStrokes[i].Id;
        }

        // Find the ink word nodes that correspond to those strokes
        ContextNodeBaseCollection selectedNodes =
            this.theInkAnalyzerBase.FindNodesOfType(System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.InkWord,
            selectedStrokeIds);

        // Toggle the confirmation type on these nodes
        foreach (ContextNodeBase selectedNode in selectedNodes)
        {
            if (selectedNode.IsConfirmed(
                System.Windows.Ink.AnalysisCore.ConfirmationType.NodeTypeAndProperties))
            {
                selectedNode.Confirm(System.Windows.Ink.AnalysisCore.ConfirmationType.None);
            }
            else
            {
                selectedNode.Confirm(System.Windows.Ink.AnalysisCore.ConfirmationType.NodeTypeAndProperties);
            }
        }

        // No longer in "confirm" mode
        this.confirmMode = false;
        this.confirmMenuItem.Checked = false;
            this.theInkCollector.Enabled = true;
    }

}

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

Spazio dei nomi System.Windows.Ink.AnalysisCore

ContextNodeBase.Confirm

ContextNodeBaseIsNodeTypeAndPropertiesConfirmed()