StylusPointProperty.Id 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
현재 StylusPointProperty의 GUID를 가져옵니다.
public:
property Guid Id { Guid get(); };
public Guid Id { get; }
member this.Id : Guid
Public ReadOnly Property Id As Guid
속성 값
현재 StylusPointProperty의 GUID입니다.
예제
다음 예제에서는 합니다 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
적용 대상
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET