StylusPointPropertyInfo 클래스

정의

StylusPoint에 있는 속성의 제약 조건을 지정합니다.Specifies the constraints of a property in a StylusPoint.

public ref class StylusPointPropertyInfo : System::Windows::Input::StylusPointProperty
public class StylusPointPropertyInfo : System.Windows.Input.StylusPointProperty
type StylusPointPropertyInfo = class
    inherit StylusPointProperty
Public Class StylusPointPropertyInfo
Inherits StylusPointProperty
상속
StylusPointPropertyInfo

예제

다음 예제에서는 StylusPointDescription 에서 개체를 StylusPointCollection 각각에 대 한 정보를 가져옵니다 StylusPointPropertyInfoStylusPointDescription합니다.The following example creates an StylusPointDescription object from a StylusPointCollection and gets the information for each StylusPointPropertyInfo in the 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

설명

StylusPointPropertyInfo 클래스에서 상속를 StylusPointProperty 클래스를 생성 합니다 Minimum, Maximum, Resolution, 및 Unit 의 속성을 정의 하는 데 사용 되는 값을 StylusPoint.The StylusPointPropertyInfo class inherits from the StylusPointProperty class and generates the Minimum, Maximum, Resolution, and Unit values used to define the properties of a StylusPoint. 각 속성 값의 유효성을 검사 디지타이저와 스타일러스의 제조업체에 따라 달라 집니다.The validity of each property value varies depending on the manufacture of the digitizer and stylus.

생성자

StylusPointPropertyInfo(StylusPointProperty)

StylusPointPropertyInfo 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the StylusPointPropertyInfo class.

StylusPointPropertyInfo(StylusPointProperty, Int32, Int32, StylusPointPropertyUnit, Single)

지정된 값을 사용하여 StylusPointPropertyInfo 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the StylusPointPropertyInfo class using the specified values.

속성

Id

현재 StylusPointProperty의 GUID를 가져옵니다.Gets the GUID for the current StylusPointProperty.

(다음에서 상속됨 StylusPointProperty)
IsButton

StylusPointProperty가 스타일러스의 단추를 나타내는지 여부를 가져옵니다.Gets whether the StylusPointProperty represents a button on the stylus.

(다음에서 상속됨 StylusPointProperty)
Maximum

StylusPoint 속성에 허용되는 최대 값을 가져옵니다.Gets the maximum value accepted for the StylusPoint property.

Minimum

StylusPoint 속성에 허용되는 최소 값을 가져옵니다.Gets the minimum value accepted for the StylusPoint property.

Resolution

StylusPoint 속성 값을 해당 단위로 변환하는 배율을 가져옵니다.Gets the scale that converts a StylusPoint property value into units.

Unit

StylusPoint 속성에서 사용되는 측정 형식을 가져옵니다.Gets the type of measurement that is used by StylusPoint property.

메서드

Equals(Object)

지정한 개체가 현재 개체와 같은지를 확인합니다.Determines whether the specified object is equal to the current object.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.Serves as the default hash function.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object.

(다음에서 상속됨 StylusPointProperty)

적용 대상