Lire en anglais

Partager via


StylusPointDescription Classe

Définition

Spécifie les propriétés figurant dans StylusPoint.

C#
public class StylusPointDescription
Héritage
StylusPointDescription

Exemples

L’exemple suivant obtient le StylusPointDescription for et StylusPointCollection obtient les informations pour chacun StylusPointPropertyInfo dans le StylusPointDescription.

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";
}

Remarques

Spécifie StylusPointDescription les propriétés associées à un StylusPoint. Pour chaque propriété d’un StylusPoint, contient StylusPointDescription un StylusPointPropertyInfo objet qui spécifie des contraintes telles que les valeurs minimales et maximales de la propriété. Utilisez les HasProperty méthodes et GetPropertyInfo pour case activée pour ces propriétés dans le StylusPointDescription.

Tous les StylusPoint objets d’un StylusPointCollection doivent partager le même StylusPointDescription. Si vous essayez d’ajouter un StylusPoint à un StylusPointCollection qui a un autre StylusPointDescription, une exception est levée.

Constructeurs

StylusPointDescription()

Initialise une nouvelle instance de la classe StylusPointDescription.

StylusPointDescription(IEnumerable<StylusPointPropertyInfo>)

Initialise une nouvelle instance de la classe StylusPointDescription avec les objets StylusPointPropertyInfo spécifiés.

Propriétés

PropertyCount

Obtient le nombre de propriétés dans StylusPointDescription.

Méthodes

AreCompatible(StylusPointDescription, StylusPointDescription)

Renvoie une valeur indiquant si les objets StylusPointDescription spécifiés sont identiques.

Equals(Object)

Détermine si l'objet spécifié est égal à l'objet actuel.

(Hérité de Object)
GetCommonDescription(StylusPointDescription, StylusPointDescription)

Retourne l'intersection des objets StylusPointDescription spécifiés.

GetHashCode()

Fait office de fonction de hachage par défaut.

(Hérité de Object)
GetPropertyInfo(StylusPointProperty)

Obtient StylusPointPropertyInfo pour la propriété spécifiée.

GetStylusPointProperties()

Obtient toutes les propriétés de l'objet StylusPointDescription.

GetType()

Obtient le Type de l'instance actuelle.

(Hérité de Object)
HasProperty(StylusPointProperty)

Renvoie une valeur qui indique si l'objet StylusPointDescription actuel contient la propriété spécifiée.

IsSubsetOf(StylusPointDescription)

Renvoie une valeur qui indique si l'objet StylusPointDescription actuel est un sous-ensemble de l'objet StylusPointDescription spécifié.

MemberwiseClone()

Crée une copie superficielle du Object actuel.

(Hérité de Object)
ToString()

Retourne une chaîne qui représente l'objet actuel.

(Hérité de Object)

S’applique à

Produit Versions
.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, 10