Condividi tramite


Metodo ContextNodeBase.IsConfirmed

Aggiornamento: novembre 2007

Ottiene un valore che indica se l'oggetto ContextNodeBase è confermato. InkAnalyzerBase non può modificare il tipo di nodo e i tratti associati per gli oggetti confermati.

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

Sintassi

'Dichiarazione
Public Function IsConfirmed ( _
    type As ConfirmationType _
) As Boolean
'Utilizzo
Dim instance As ContextNodeBase
Dim type As ConfirmationType
Dim returnValue As Boolean

returnValue = instance.IsConfirmed(type)
public bool IsConfirmed(
    ConfirmationType type
)
public:
bool IsConfirmed(
    ConfirmationType type
)
public boolean IsConfirmed(
    ConfirmationType type
)
public function IsConfirmed(
    type : ConfirmationType
) : boolean

Parametri

Valore restituito

Tipo: System.Boolean
true se il tipo di nodo è confermato. In caso contrario, false.

Note

Questo valore è impostato dal metodo Confirm.

Esempi

L'esempio seguente è un gestore dell'evento MouseUp in un oggetto Panel, theNotesPanel che raccoglie input penna tramite un oggetto InkCollector denominato theInkCollector. L'applicazione presenta un valore Boolean denominato 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 di spostamento del mouse verso l'alto in coordinate di input penna. 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

ContextNodeBase Classe

Membri ContextNodeBase

Spazio dei nomi System.Windows.Ink.AnalysisCore

ContextNodeBase.Confirm