ValidationOptionAttribute Classe

Definizione

Attenzione

The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*

Attributo personalizzato che contiene informazioni sulla classe ValidationOption. La classe non può essere ereditata.

public ref class ValidationOptionAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Event | System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
public sealed class ValidationOptionAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Event | System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public sealed class ValidationOptionAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Event | System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)>]
type ValidationOptionAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Event | System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)>]
[<System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")>]
type ValidationOptionAttribute = class
    inherit Attribute
Public NotInheritable Class ValidationOptionAttribute
Inherits Attribute
Ereditarietà
ValidationOptionAttribute
Attributi

Commenti

Nota

In questo materiale vengono descritti tipi e spazi dei nomi obsoleti. Per altre informazioni, vedere Deprecated Types in Windows Workflow Foundation 4.5 (Tipi deprecati in Windows Workflow Foundation 4.5).

Questo attributo deve essere utilizzato solo come opzione della proprietà dipendenza. Gli attributi vengono ignorati se dichiarati in una proprietà .NET.

La classe ValidationOptionAttribute deve essere utilizzata solo sulle metaproprietà. Verrà ignorata per le proprietà delle istanze. Per ulteriori informazioni, vedere utilizzo delle proprietà dell'attività .

Se la classe ValidationOptionAttribute non viene specificata, il comportamento predefinito è ValidationOption.Optional.

public sealed partial class Activity1: Activity  
{  
    public Activity1()  
    {  
    }  

    public static DependencyProperty MyPropertyProperty =   
        DependencyProperty.Register(  
            "MyProperty",   
            typeof(string),   
            typeof(Activity1),  
            new PropertyMetadata(  
                DependencyPropertyOptions.Metadata,  
                new ValidationOptionAttribute(ValidationOption.Required)));  

    [Browsable(true)]  
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]  
    public string MyProperty  
    {  
        get  
        {  
            return ((string)(base.GetValue(Activity1.MyPropertyProperty)));  
        }  
        set  
        {  
            base.SetValue(Activity1.MyPropertyProperty, value);  
        }  
    }  
}  

Costruttori

ValidationOptionAttribute(ValidationOption)

Inizializza una nuova istanza della classe ValidationOptionAttribute con un valore per la proprietà ValidationOption.

Proprietà

TypeId

Quando è implementata in una classe derivata, ottiene un identificatore univoco della classe Attribute.

(Ereditato da Attribute)
ValidationOption

Ottiene il valore della classe ValidationOption associata all'istanza.

Metodi

Equals(Object)

Restituisce un valore che indica se questa istanza è uguale a un oggetto specificato.

(Ereditato da Attribute)
GetHashCode()

Restituisce il codice hash per l'istanza.

(Ereditato da Attribute)
GetType()

Ottiene l'oggetto Type dell'istanza corrente.

(Ereditato da Object)
IsDefaultAttribute()

In caso di override in una classe derivata, indica se il valore di questa istanza è il valore predefinito per la classe derivata.

(Ereditato da Attribute)
Match(Object)

Quando è sottoposto a override in una classe derivata, restituisce un valore che indica se questa istanza equivale a un oggetto specificato.

(Ereditato da Attribute)
MemberwiseClone()

Crea una copia superficiale dell'oggetto Object corrente.

(Ereditato da Object)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Implementazioni dell'interfaccia esplicita

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Esegue il mapping di un set di nomi a un set corrispondente di ID dispatch.

(Ereditato da Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Recupera le informazioni sul tipo relative a un oggetto, che possono essere usate per ottenere informazioni sul tipo relative a un'interfaccia.

(Ereditato da Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Recupera il numero delle interfacce di informazioni sul tipo fornite da un oggetto (0 o 1).

(Ereditato da Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Fornisce l'accesso a proprietà e metodi esposti da un oggetto.

(Ereditato da Attribute)

Si applica a