.NET Framework Class Library
ValidationOptionAttribute Class

Custom attribute that contains ValidationOption information. This class cannot be inherited.

Namespace:  System.Workflow.ComponentModel.Compiler
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)
Syntax

Visual Basic (Declaration)
<AttributeUsageAttribute(AttributeTargets.Property Or AttributeTargets.Event, AllowMultiple := False,  _
    Inherited := True)> _
Public NotInheritable Class ValidationOptionAttribute _
    Inherits Attribute
Visual Basic (Usage)
Dim instance As ValidationOptionAttribute
C#
[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Event, AllowMultiple = false, 
    Inherited = true)]
public sealed class ValidationOptionAttribute : Attribute
Visual C++
[AttributeUsageAttribute(AttributeTargets::Property|AttributeTargets::Event, AllowMultiple = false, 
    Inherited = true)]
public ref class ValidationOptionAttribute sealed : public Attribute
JScript
public final class ValidationOptionAttribute extends Attribute
Remarks

This attribute should only be used as dependency property option. Attributes are ignored if declared on a .NET property.

The ValidationOptionAttribute is intended to be used on Meta-properties only. It will be ignored for instance properties. For more information, see Using Activity Properties for more details.

If the ValidationOptionAttribute is not specified, the behavior defaults to ValidationOption..::.Optional.

C#
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);
        }
    }
}
Inheritance Hierarchy

System..::.Object
  System..::.Attribute
    System.Workflow.ComponentModel.Compiler..::.ValidationOptionAttribute
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0
See Also

Reference

Tags :


Page view tracker