ValidatorInstance Property
Collapse the table of content
Expand the table of content

IntegerValidatorAttribute.ValidatorInstance Property


Gets an instance of the IntegerValidator class.

Namespace:   System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)

Public Overrides ReadOnly Property ValidatorInstance As ConfigurationValidatorBase

You use the ValidatorInstance property to perform string validation by calling its Validate method.

The following example shows how to use the ValidatorInstance property.

        Dim valBase As ConfigurationValidatorBase
        Dim intValAttr As IntegerValidatorAttribute
        intValAttr = New IntegerValidatorAttribute()

        Dim badValue As Long = 10
        Dim goodValue As Integer = 10

            valBase = intValAttr.ValidatorInstance
            ' valBase.Validate(badValue);
        Catch e As ArgumentException
            ' Display error message.
            Dim msg As String = e.ToString()
#If DEBUG Then
#End If
        End Try '

.NET Framework
Available since 2.0
Return to top
© 2016 Microsoft