TabletPropertyDescriptionCollection.Add 方法

TabletPropertyDescription 对象添加到 TabletPropertyDescriptionCollection 集合的末尾。

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
Public Function Add ( _
    value As TabletPropertyDescription _
) As Integer
用法
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 int Add(
    TabletPropertyDescription value
)
public function Add(
    value : TabletPropertyDescription
) : int

参数

返回值

类型:System.Int32
TabletPropertyDescriptionCollection 集合中的 TabletPropertyDescription 对象的从零开始的索引。

示例

在此示例中,为指定的 Tablet 对象所支持的每个数据包属性都创建一个 TabletPropertyDescriptionCollection 集合,并用 TabletPropertyDescription 对象填充该集合。

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

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

TabletPropertyDescriptionCollection 类

TabletPropertyDescriptionCollection 成员

Microsoft.Ink 命名空间

TabletPropertyDescription