IStylusSyncPlugin.CustomStylusDataAdded Method

IStylusSyncPlugin.CustomStylusDataAdded Method

Informs the implementing plug-in that custom stylus data is available.

Definition

Visual Basic .NET Public Sub CustomStylusDataAdded( _
ByVal sender As RealTimeStylus, _
ByVal data As CustomStylusData _
)
C# public void CustomStylusDataAdded(
RealTimeStylus sender,
CustomStylusData data
);
Managed C++ public: void CustomStylusDataAdded(
RealTimeStylus *sender,
CustomStylusData *data
);

Parameters

sender Microsoft.StylusInput.RealTimeStylus. The RealTimeStylus object that sent the custom data.
data Microsoft.StylusInput.PluginData.CustomStylusData. The CustomStylusData object sent by the RealTimeStylus object.

Examples

[C#]

This C# example is excerpted from the 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;
            }
        }
    }
}

[Visual Basic .NET]

This example is excerpted from the RealTimeStylus Plug-in Sample.

Public Sub CustomStylusDataAdded(sender As RealTimeStylus, data As CustomStylusData)
  ' 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

See Also