Show / Hide Table of Contents

Class ParameterValidation

Used to validate user-inputted form data and present error messages.

Inheritance
System.Object
ParameterValidation
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Phoenix.Views.Parameters
Assembly: Phoenix.Abstractions.Views.dll
Syntax
public static class ParameterValidation

Methods

View Source

GetValidationError(Object, Object, Type, AllowedValuesModel, Boolean)

Validates the value.

Declaration
public static string GetValidationError(object oldValue, object value, Type valueType, AllowedValuesModel allowedValues, bool isPath)
Parameters
Type Name Description
System.Object oldValue

The old value, or a default value.

System.Object value

The value to validate.

System.Type valueType

The desired value type.

AllowedValuesModel allowedValues

The allowed values, if any.

System.Boolean isPath
Returns
Type Description
System.String

Null if there was no error or a string indicating the error.

View Source

TryConvertValue(Object, Object, Type, out Object)

Converts a value to the correct type as specified.

Declaration
public static bool TryConvertValue(object oldValue, object value, Type valueType, out object convertedValue)
Parameters
Type Name Description
System.Object oldValue

The old value, or a default value.

System.Object value

The value to validate.

System.Type valueType

The desired value type.

System.Object convertedValue

the out parameter where the correctly typed value is stored or null.

Returns
Type Description
System.Boolean

a value representing whether or not the conversion was a success.

  • View Source
In This Article
Back to top Generated by DocFX