Compartir a través de


InkCollector.Cursors (Propiedad)

Actualización: noviembre 2007

Obtiene la colección Cursors que se puede usar en la región de entradas manuscritas.

Espacio de nombres:  Microsoft.Ink
Ensamblado:  Microsoft.Ink (en Microsoft.Ink.dll)

Sintaxis

'Declaración
Public ReadOnly Property Cursors As Cursors
'Uso
Dim instance As InkCollector
Dim value As Cursors

value = instance.Cursors
public Cursors Cursors { get; }
public:
property Cursors^ Cursors {
    Cursors^ get ();
}
/** @property */
public Cursors get_Cursors()
public function get Cursors () : Cursors

Valor de propiedad

Tipo: Microsoft.Ink.Cursors
Colección Cursors que se puede usar en la región de entradas manuscritas.

Comentarios

Cada cursor se corresponde con la punta de la pluma o con otro dispositivo de lectura de entrada manuscrita.

Los cursores de esta colección son locales con respecto a un objeto InkCollector.

Cualquier nuevo cursor que encuentre el objeto InkCollector se agrega a la colección Cursors devuelta, aunque los cursores no se devuelven necesariamente en el orden en que los encuentra el objeto InkCollector.

Al habilitar un mouse como un dispositivo de entrada en el objeto InkCollector (cuando el parámetro useMouseForInput del método SetAllTabletsMode es true), el mouse se agrega a la colección Cursors después de que el objeto InkCollector encuentra cualquier otro cursor, por ejemplo una pluma. Esto se debe a que la pluma también se comporta como un mouse.

Nota

El evento CursorInRange se recibe para el cursor del mouse después de que cualquier otro cursor, por ejemplo una pluma, dibuja un trazo (que desencadena el evento Stroke).

La colección Cursors se borra (el recuento se establece en 0, no conteniendo ningún objeto) cuando:

Ejemplos

En este ejemplo de C# se devuelve un informe sobre los atributos de todos los cursores que ha visto el objeto InkCollector pasado como parámetro.

using Microsoft.Ink;
//. . .
public string CursorReport(InkCollector theInkCollector)
{
    string theReport = "The InkCollector has encountered the following cursors so far:" + Environment.NewLine;
    // Get the Cursors collection from the InkCollector
    Microsoft.Ink.Cursors theCursors = theInkCollector.Cursors;
    // Prevent changes to the collection while we iterate over it.
    lock( theCursors.SyncRoot )
    {
        theReport += "Count of cursors: " + theCursors.Count + Environment.NewLine + Environment.NewLine ;
        foreach (Microsoft.Ink.Cursor cursor in theCursors)
        {
            theReport += "Cursor Name: " + cursor.Name + Environment.NewLine;
            theReport += "Cursor ToString: " + cursor.ToString() + Environment.NewLine;
            theReport += "Tablet Name: " + cursor.Tablet.Name  + Environment.NewLine;
            theReport += "Cursor Id: " + cursor.Id.ToString()  + Environment.NewLine;
            theReport += "Cursor is inverted: " + cursor.Inverted.ToString()  + Environment.NewLine;
            theReport += "Cursor Buttons:" + Environment.NewLine;
            foreach (CursorButton button in cursor.Buttons)
            {
                CursorButtonState theState = button.State;
                theReport += "    Button Name: " + button.Name + Environment.NewLine;
                theReport += "    State: " + button.State.ToString() + Environment.NewLine;
                theReport += "    Id: " + button.Id.ToString()  + Environment.NewLine + Environment.NewLine;
            }
        }
    }
    return theReport;
}

En este ejemplo de Microsoft® Visual Basic® .NET se devuelve un informe de los atributos de todos los cursores que ha visto el objeto InkCollector pasado como parámetro.

Imports Microsoft.Ink
'. . .
Public Function CursorReport(ByVal theInkCollector As InkCollector) _
    As String
    Dim theReport As String = "The InkCollector has encountered " & _
        "the following cursors so far:" & vbCrLf
    ' Get the Cursors collection from the InkCollector
    Dim theCursors As Cursors = theInkCollector.Cursors
    ' Prevent changes to the collection while we iterate over it.
    SyncLock theCursors.SyncRoot
        theReport &= "Count of cursors: " & theCursors.Count & vbCrLf
        Dim theCursor As Cursor
        For Each theCursor In theCursors
            theReport &= "Cursor Name: " & theCursor.Name & vbCrLf
            theReport &= "Cursor ToString: " & theCursor.ToString() & _
                vbCrLf
            theReport &= "Tablet Name: " & theCursor.Tablet.Name & vbCrLf
            theReport &= "Cursor Id: " & theCursor.Id.ToString() & vbCrLf
            theReport &= "Cursor is inverted: " & _
                theCursor.Inverted.ToString() & vbCrLf
            theReport &= "Cursor Buttons:" & vbCrLf
            Dim theButton As CursorButton
            For Each theButton In theCursor.Buttons
                Dim theState As CursorButtonState = theButton.State
                theReport &= "    Button Name: " & theButton.Name & vbCrLf
                theReport &= "    State: " & _
                    theButton.State.ToString() & vbCrLf
                theReport &= "    Id: " & theButton.Id.ToString() & _
                    vbCrLf & vbCrLf
            Next
        Next
    End SyncLock
    Return theReport
End Function

Plataformas

Windows Vista

.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Información de versión

.NET Framework

Compatible con: 3.0

Vea también

Referencia

InkCollector (Clase)

InkCollector (Miembros)

Microsoft.Ink (Espacio de nombres)

Cursors

Cursor

InkCollector.SetSingleTabletIntegratedMode

InkCollector.SetAllTabletsMode