閱讀英文

共用方式為


StylusPointPropertyInfo 類別

定義

指定 StylusPoint 中屬性的條件約束 (Constraint)。

C#
public class StylusPointPropertyInfo : System.Windows.Input.StylusPointProperty
繼承
StylusPointPropertyInfo

範例

下列範例會StylusPointDescriptionStylusPointCollection 建立物件,並取得 中StylusPointDescription每個 StylusPointPropertyInfo 的資訊。

C#
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();
}
C#
// 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";
}

備註

類別StylusPointPropertyInfo繼承自 StylusPointProperty 類別,併產生MaximumMinimum、、 ResolutionUnit 值,用來定義 的屬性StylusPoint。 每個屬性值的有效性會根據數位板和手寫筆的製造而有所不同。

建構函式

屬性

Id

取得目前 StylusPointProperty 的 GUID。

(繼承來源 StylusPointProperty)
IsButton

取得 StylusPointProperty 是否表示手寫筆上的按鈕。

(繼承來源 StylusPointProperty)
Maximum

取得 StylusPoint 屬性接受的最大值。

Minimum

取得 StylusPoint 屬性接受的最小值。

Resolution

取得將 StylusPoint 屬性值轉換為單位的縮放。

Unit

取得 StylusPoint 屬性所使用的度量型別。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 StylusPointProperty)

適用於

產品 版本
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9