Freigeben über


IStylusAsyncPlugin.CustomStylusDataAdded-Methode

Benachrichtigt das implementierende Plug-In darüber, dass CustomStylusData verfügbar ist.

Namespace:  Microsoft.StylusInput
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
Sub CustomStylusDataAdded ( _
    sender As RealTimeStylus, _
    data As CustomStylusData _
)
'Usage
Dim instance As IStylusAsyncPlugin
Dim sender As RealTimeStylus
Dim data As CustomStylusData

instance.CustomStylusDataAdded(sender, _
    data)
void CustomStylusDataAdded(
    RealTimeStylus sender,
    CustomStylusData data
)
void CustomStylusDataAdded(
    RealTimeStylus^ sender, 
    CustomStylusData^ data
)
void CustomStylusDataAdded(
    RealTimeStylus sender,
    CustomStylusData data
)
function CustomStylusDataAdded(
    sender : RealTimeStylus, 
    data : CustomStylusData
)

Parameter

Beispiele

Dieses C#-Beispiel ist ein Auszug aus dem RealTimeStylus Plug-in Sample.

public void CustomStylusDataAdded(RealTimeStylus sender, CustomStylusData data)
{
    // We can identify the kind of custom data via either the Guid or Type.
    // For the purpose of this demonstration we will validate both just to be safe.
    // For other scenarios either approach is valid.
    if (data.CustomDataId == GestureRecognizer.GestureRecognitionDataGuid)
    {
        GestureRecognitionData grd = data.Data as GestureRecognitionData;
        if (grd != null)
        {
            if (grd.Count > 0)
            {
                GestureAlternate ga = grd[0];
                sbGesture.Text = "Gesture=" + ga.Id + ", Confidence=" + ga.Confidence;
            }
        }
    }
}

Dieses Microsoft Visual Basic .NET-Beispiel ist ein Auszug aus dem RealTimeStylus Plug-in Sample.

Public Sub CustomStylusDataAdded(sender As RealTimeStylus, data As CustomStylusData)
  Implements IStylusAsyncPlugin.CustomStylusDataAdded
    ' We can identify the kind of custom data via either the Guid or Type.
    ' For the purpose of this demonstration we will validate both just to be safe.
    ' For other scenarios either approach is valid.
    If data.CustomDataId = GestureRecognizer.GestureRecognitionDataGuid Then
      Dim grd As GestureRecognitionData = CType(data.Data, GestureRecognitionData)
      If Not (grd Is Nothing) Then
        If grd.Count > 0 Then
          Dim ga As GestureAlternate = grd(0)
          sbGesture.Text = "Gesture=" + ga.Id + ", Confidence=" + ga.Confidence
        End If
      End If
    End If
End Sub 'CustomStylusDataAdded

Plattformen

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework und .NET Compact Framework unterstützen nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.

Versionsinformationen

.NET Framework

Unterstützt in: 3.0

Siehe auch

Referenz

IStylusAsyncPlugin-Schnittstelle

IStylusAsyncPlugin-Member

Microsoft.StylusInput-Namespace

CustomStylusData