StylusPointPropertyUnit 열거형
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
StylusPoint 속성의 측정 단위를 지정합니다.
public enum class StylusPointPropertyUnit
public enum StylusPointPropertyUnit
type StylusPointPropertyUnit =
Public Enum StylusPointPropertyUnit
- 상속
필드
Centimeters | 2 | StylusPoint 속성이 센티미터 단위로 측정됨을 나타냅니다. |
Degrees | 3 | StylusPoint 속성이 도 단위로 측정됨을 나타냅니다. |
Grams | 7 | StylusPoint 속성이 그램 단위로 측정됨을 나타냅니다. |
Inches | 1 | StylusPoint 속성이 인치 단위로 측정됨을 나타냅니다. |
None | 0 | StylusPoint 속성의 단위가 지정되어 있지 않음을 나타냅니다. |
Pounds | 6 | StylusPoint 속성이 파운드 단위로 측정됨을 나타냅니다. |
Radians | 4 | StylusPoint 속성이 라디안 단위로 측정됨을 나타냅니다. |
Seconds | 5 | StylusPoint 속성이 초 단위로 측정됨을 나타냅니다. |
예제
다음 예제에서는 StylusPointDescription 에서 개체를 StylusPointCollection 각각에 대 한 정보를 가져옵니다 StylusPointPropertyInfo 에 StylusPointDescription합니다.
private void WriteDescriptionInfo(StylusPointCollection points)
{
StylusPointDescription pointsDescription = points.Description;
ReadOnlyCollection<StylusPointPropertyInfo> properties =
pointsDescription.GetStylusPointProperties();
StringWriter descriptionStringWriter = new StringWriter();
descriptionStringWriter.Write("Property Count:{0}", pointsDescription.PropertyCount.ToString());
foreach (StylusPointPropertyInfo property in properties)
{
// GetStylusPointPropertyName is defined below and returns the
// name of the property.
descriptionStringWriter.Write("name = {0}", GetStylusPointPropertyName(property).ToString());
descriptionStringWriter.WriteLine(" Guid = {0}", property.Id.ToString());
descriptionStringWriter.Write(" IsButton = {0}", property.IsButton.ToString());
descriptionStringWriter.Write(" Min = {0}", property.Minimum.ToString());
descriptionStringWriter.Write(" Max = {0}", property.Maximum.ToString());
descriptionStringWriter.Write(" Unit = {0}", property.Unit.ToString());
descriptionStringWriter.WriteLine(" Res {0}", property.Resolution.ToString());
}
descriptionOutput.Text = descriptionStringWriter.ToString();
}
Private Sub WriteDescriptionInfo(ByVal points As StylusPointCollection)
Dim pointsDescription As StylusPointDescription = points.Description
Dim properties As ReadOnlyCollection(Of StylusPointPropertyInfo) = _
pointsDescription.GetStylusPointProperties()
Dim descriptionStringWriter As New StringWriter
descriptionStringWriter.Write("Property Count:{0}", pointsDescription.PropertyCount.ToString())
Dim pointProperty As StylusPointPropertyInfo
For Each pointProperty In properties
' GetStylusPointPropertyName is defined below and returns the
' name of the property.
descriptionStringWriter.Write("name = {0}", GetStylusPointPropertyName(pointProperty).ToString())
descriptionStringWriter.WriteLine(" Guid = {0}", pointProperty.Id.ToString())
descriptionStringWriter.Write(" IsButton = {0}", pointProperty.IsButton.ToString())
descriptionStringWriter.Write(" Min = {0}", pointProperty.Minimum.ToString())
descriptionStringWriter.Write(" Max = {0}", pointProperty.Maximum.ToString())
descriptionStringWriter.Write(" Unit = {0}", pointProperty.Unit.ToString())
descriptionStringWriter.WriteLine(" Res {0}", pointProperty.Resolution.ToString())
Next pointProperty
descriptionOutput.Text = descriptionStringWriter.ToString()
End Sub
// Use reflection to get the name of currentProperty.
private string GetStylusPointPropertyName(StylusPointProperty currentProperty)
{
Guid guid = currentProperty.Id;
// Iterate through the StylusPointProperties to find the StylusPointProperty
// that matches currentProperty, then return the name.
foreach (FieldInfo theFieldInfo
in typeof(StylusPointProperties).GetFields())
{
StylusPointProperty property = (StylusPointProperty) theFieldInfo.GetValue(currentProperty);
if (property.Id == guid)
{
return theFieldInfo.Name;
}
}
return "Not found";
}
' Use reflection to get the name of currentProperty.
Private Function GetStylusPointPropertyName(ByVal currentProperty As StylusPointProperty) As String
Dim guid As Guid = currentProperty.Id
' Iterate through the StylusPointProperties to find the StylusPointProperty
' that matches currentProperty, then return the name.
Dim theFieldInfo As FieldInfo
For Each theFieldInfo In GetType(StylusPointProperties).GetFields()
Dim pointProperty As StylusPointProperty = _
CType(theFieldInfo.GetValue(currentProperty), StylusPointProperty)
If pointProperty.Id = guid Then
Return theFieldInfo.Name
End If
Next theFieldInfo
Return "Not found"
End Function 'GetStylusPointPropertyName
적용 대상
.NET