Share via


TabletPropertyDescriptionCollection.Add Method

Adds a TabletPropertyDescription object to the end of the TabletPropertyDescriptionCollection collection.

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

Syntax

'Declaration
Public Function Add ( _
    value As TabletPropertyDescription _
) As Integer
'Usage
Dim instance As TabletPropertyDescriptionCollection 
Dim value As TabletPropertyDescription 
Dim returnValue As Integer 

returnValue = instance.Add(value)
public int Add(
    TabletPropertyDescription value
)
public:
int Add(
    TabletPropertyDescription^ value
)
public function Add(
    value : TabletPropertyDescription
) : int

Parameters

Return Value

Type: System.Int32
The zero-based index of the TabletPropertyDescription object within the TabletPropertyDescriptionCollection collection.

Examples

In this example, a TabletPropertyDescriptionCollection collection is created and populated with TabletPropertyDescription objects for each packet property that is supported by the specified Tablet object.

Private Function GetPropertyDescriptionCollection(ByVal theTablet As Tablet) As TabletPropertyDescriptionCollection

    Dim Result As TabletPropertyDescriptionCollection = New TabletPropertyDescriptionCollection()

    For Each PropertyID As Guid In GetPacketPropertyList()

        If theTablet.IsPacketPropertySupported(PropertyID) Then 
            ' get the property metrics 
            Dim Metrics As TabletPropertyMetrics = theTablet.GetPropertyMetrics(PropertyID)
            ' add to the collection
            Result.Add(New TabletPropertyDescription(PropertyID, Metrics))
        End If 

    Next 

    Return Result

End Function 


' returns a list of all Packet Property Guids 
Private Function GetPacketPropertyList() As List(Of Guid)
    Dim Result As List(Of Guid) = New List(Of Guid)()
    Result.Add(PacketProperty.AltitudeOrientation)
    Result.Add(PacketProperty.AzimuthOrientation)
    Result.Add(PacketProperty.ButtonPressure)
    Result.Add(PacketProperty.Height)
    Result.Add(PacketProperty.NormalPressure)
    Result.Add(PacketProperty.PacketStatus)
    Result.Add(PacketProperty.PitchRotation)
    Result.Add(PacketProperty.RollRotation)
    Result.Add(PacketProperty.SerialNumber)
    Result.Add(PacketProperty.SystemTouch)
    Result.Add(PacketProperty.TangentPressure)
    Result.Add(PacketProperty.TimerTick)
    Result.Add(PacketProperty.TwistOrientation)
    Result.Add(PacketProperty.Width)
    Result.Add(PacketProperty.X)
    Result.Add(PacketProperty.XTiltOrientation)
    Result.Add(PacketProperty.Y)
    Result.Add(PacketProperty.YawRotation)
    Result.Add(PacketProperty.YTiltOrientation)
    Result.Add(PacketProperty.Z)
    Return Result
End Function
private TabletPropertyDescriptionCollection GetPropertyDescriptionCollection(Tablet theTablet)
{
    TabletPropertyDescriptionCollection Result = new TabletPropertyDescriptionCollection();
    foreach (Guid PropertyID in GetPacketPropertyList())
    {
        if (theTablet.IsPacketPropertySupported(PropertyID))
        {
            // get the property metrics
            TabletPropertyMetrics Metrics = theTablet.GetPropertyMetrics(PropertyID);
            //  add to the collection
            Result.Add(new TabletPropertyDescription(PropertyID, Metrics));
        }
    }
    return Result;
}

// returns a list of all Packet Property Guids 
private List<Guid> GetPacketPropertyList()
{
    List<Guid> Result = new List<Guid>();
    Result.Add(PacketProperty.AltitudeOrientation);
    Result.Add(PacketProperty.AzimuthOrientation);
    Result.Add(PacketProperty.ButtonPressure);
    Result.Add(PacketProperty.Height);
    Result.Add(PacketProperty.NormalPressure);
    Result.Add(PacketProperty.PacketStatus);
    Result.Add(PacketProperty.PitchRotation);
    Result.Add(PacketProperty.RollRotation);
    Result.Add(PacketProperty.SerialNumber);
    Result.Add(PacketProperty.SystemTouch);
    Result.Add(PacketProperty.TangentPressure);
    Result.Add(PacketProperty.TimerTick);
    Result.Add(PacketProperty.TwistOrientation);
    Result.Add(PacketProperty.Width);
    Result.Add(PacketProperty.X);
    Result.Add(PacketProperty.XTiltOrientation);
    Result.Add(PacketProperty.Y);
    Result.Add(PacketProperty.YawRotation);
    Result.Add(PacketProperty.YTiltOrientation);
    Result.Add(PacketProperty.Z);
    return Result;
}

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

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

TabletPropertyDescriptionCollection Class

TabletPropertyDescriptionCollection Members

Microsoft.Ink Namespace

TabletPropertyDescription