Class DataTypes

Used to validate input to XForm input controls.

Inheritance
System.Object
DataTypes
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.XForms
Assembly: EPiServer.XForms.dll
Version: 8.11.0
Syntax
public class DataTypes

Properties

InvalidDefaultInputRegex

A string representing an regular expression that is used when validating input data that does not have a type specified.

Declaration
public static string InvalidDefaultInputRegex { get; set; }
Property Value
Type Description
System.String
Remarks

Any data that has no type specified will be validated against this expression. If the expression results in a match the value will consider not valid. Default value is "<>"

Types

A Hashtable containing the available types for input fields. Every type corresponds to a regular expression that is used to validate input data.

Declaration
public static Hashtable Types { get; set; }
Property Value
Type Description
System.Collections.Hashtable

Methods

Validate(String, String)

Validates a value against a give type.

Declaration
public static bool Validate(string type, string value)
Parameters
Type Name Description
System.String type

The type to validate against.

System.String value

The string to validate.

Returns
Type Description
System.Boolean

True if the input is valid, false otherwise.

Remarks

A null value or String.Empty will always return true. If the type is not registrered in the Types property the return value will always be true.

ValidateDefaultTypedData(String)

Validates a string value against a regular expression created using InvalidDefaultInputRegex.

Declaration
public static bool ValidateDefaultTypedData(string value)
Parameters
Type Name Description
System.String value

The string to validate.

Returns
Type Description
System.Boolean

True if the input is valid, false otherwise.

Remarks

A null value or String.Empty will always return true.