StylusPointDescription 클래스

정의

StylusPoint에 있는 속성을 지정합니다.Specifies the properties that are in a StylusPoint.

public ref class StylusPointDescription
public class StylusPointDescription
type StylusPointDescription = class
Public Class StylusPointDescription
상속
StylusPointDescription

예제

다음 예제는 StylusPointDescriptionStylusPointCollection 각각에 대 한 정보를 가져옵니다. StylusPointPropertyInfoStylusPointDescription.The following example gets the StylusPointDescription for 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

설명

A StylusPointDescription 연결 된 속성을 지정 된 StylusPoint.A StylusPointDescription specifies which properties are associated with a StylusPoint. 각 속성에 대 한 StylusPoint, StylusPointDescription 포함 한 StylusPointPropertyInfo 제약 조건 속성의 최소값과 최대값을 지정 하는 개체.For each property in a StylusPoint, the StylusPointDescription contains a StylusPointPropertyInfo object which specifies constraints such as the minimum and maximum values of the property. 사용의 HasPropertyGetPropertyInfo 에서 이러한 속성을 확인 하는 메서드는 StylusPointDescription.Use the HasProperty and GetPropertyInfo methods to check for these properties in the StylusPointDescription.

모든 StylusPoint 개체는 StylusPointCollection 같은 공유 해야 합니다 StylusPointDescription.All StylusPoint objects in a StylusPointCollection must share the same StylusPointDescription. 추가 하려고 하는 경우는 StylusPointStylusPointCollection 를 가진 다른 StylusPointDescription, 예외가 throw 됩니다.If you try to add a StylusPoint to a StylusPointCollection that has a different StylusPointDescription, an exception will be thrown.

생성자

StylusPointDescription()

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

StylusPointDescription(IEnumerable<StylusPointPropertyInfo>)

지정된 StylusPointDescription 개체를 사용하여 StylusPointPropertyInfo 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the StylusPointDescription class with the specified StylusPointPropertyInfo objects.

속성

PropertyCount

StylusPointDescription의 속성 수를 가져옵니다.Gets the number of properties in the StylusPointDescription.

메서드

AreCompatible(StylusPointDescription, StylusPointDescription)

지정된 StylusPointDescription 개체가 동일한지 여부를 나타내는 값을 반환합니다.Returns a value that indicates whether the specified StylusPointDescription objects are identical.

Equals(Object)

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

(다음에서 상속됨 Object)
GetCommonDescription(StylusPointDescription, StylusPointDescription)

지정된 StylusPointDescription 개체의 교집합을 반환합니다.Returns the intersection of the specified StylusPointDescription objects.

GetHashCode()

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

(다음에서 상속됨 Object)
GetPropertyInfo(StylusPointProperty)

지정된 속성에 대한 StylusPointPropertyInfo를 가져옵니다.Gets the StylusPointPropertyInfo for the specified property.

GetStylusPointProperties()

StylusPointDescription의 모든 속성을 가져옵니다.Gets all the properties of the StylusPointDescription.

GetType()

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

(다음에서 상속됨 Object)
HasProperty(StylusPointProperty)

현재 StylusPointDescription에 지정된 속성이 있는지 여부를 나타내는 값을 반환합니다.Returns a value that indicates whether the current StylusPointDescription has the specified property.

IsSubsetOf(StylusPointDescription)

현재 StylusPointDescription이 지정된 StylusPointDescription의 하위 집합인지 여부를 나타내는 값을 반환합니다.Returns a value that indicates whether the current StylusPointDescription is a subset of the specified StylusPointDescription.

MemberwiseClone()

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

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

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

(다음에서 상속됨 Object)

적용 대상