Export (0) Print
Expand All

IStylusSyncPlugin.CustomStylusDataAdded Method

Notifies the implementing plug-in that CustomStylusData is available.

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

void CustomStylusDataAdded(
	RealTimeStylus sender,
	CustomStylusData data
)

Parameters

sender
Type: Microsoft.StylusInput.RealTimeStylus

The RealTimeStylus object that sent the custom data.

data
Type: Microsoft.StylusInput.PluginData.CustomStylusData

The CustomStylusData object sent by the RealTimeStylus object.

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

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.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft