Share via


IStylusSyncPlugin.CustomStylusDataAdded Method

Notifies the implementing plug-in that CustomStylusData is available.

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

Syntax

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

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

Parameters

Examples

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;
            }
        }
    }
}

This Microsoft Visual Basic .NET example is excerpted from the RealTimeStylus Plug-in Sample.

Public Sub CustomStylusDataAdded(sender As RealTimeStylus, data As CustomStylusData) _
  Implements IStylusSyncPlugin.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

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

IStylusSyncPlugin Interface

IStylusSyncPlugin Members

Microsoft.StylusInput Namespace

CustomStylusData