C# Класс RangeAttribute, i18N-Complete

i18N localized version of System.ComponentModel.DataAnnotations.RangeAttribute class.

Specifies the numeric range constraints for the value of a data field.

Наследование: System.ComponentModel.DataAnnotations.RangeAttribute
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
FormatErrorMessage ( string name ) : string

Formats the error message that is displayed when range validation fails.

RangeAttribute ( Type type, string minimum, string maximum ) : System

Initializes a new instance of the System.ComponentModel.DataAnnotations.RangeAttribute class by using the specified minimum and maximum values whose error message is localized.

ErrorMessage is set to:

The field {0} must be between {1} and {2}.

RangeAttribute ( double minimum, double maximum ) : System

Initializes a new instance of the System.ComponentModel.DataAnnotations.RangeAttribute class by using the specified minimum and maximum values whose error message is localized.

ErrorMessage is set to:

The field {0} must be between {1} and {2}.

RangeAttribute ( int minimum, int maximum ) : System

Initializes a new instance of the System.ComponentModel.DataAnnotations.RangeAttribute class by using the specified minimum and maximum values whose error message is localized.

ErrorMessage is set to:

The field {0} must be between {1} and {2}.

RangeAttribute ( string errorMessage, Type type, string minimum, string maximum ) : System

Initializes a new instance of the System.ComponentModel.DataAnnotations.RangeAttribute class by using the specified minimum and maximum values whose error message is localized.

RangeAttribute ( string errorMessage, double minimum, double maximum ) : System

Initializes a new instance of the System.ComponentModel.DataAnnotations.RangeAttribute class by using the specified minimum and maximum values whose error message is localized.

RangeAttribute ( string errorMessage, int minimum, int maximum ) : System

Initializes a new instance of the System.ComponentModel.DataAnnotations.RangeAttribute class by using the specified minimum and maximum values whose error message is localized.

Описание методов

FormatErrorMessage() публичный Метод

Formats the error message that is displayed when range validation fails.
public FormatErrorMessage ( string name ) : string
name string The name of the field that caused the validation failure.
Результат string

RangeAttribute() публичный Метод

Initializes a new instance of the System.ComponentModel.DataAnnotations.RangeAttribute class by using the specified minimum and maximum values whose error message is localized.

ErrorMessage is set to:

The field {0} must be between {1} and {2}.

public RangeAttribute ( Type type, string minimum, string maximum ) : System
type Type Specifies the type of the object to test.
minimum string Specifies the minimum value allowed for the data field value.
maximum string Specifies the maximum value allowed for the data field value.
Результат System

RangeAttribute() публичный Метод

Initializes a new instance of the System.ComponentModel.DataAnnotations.RangeAttribute class by using the specified minimum and maximum values whose error message is localized.

ErrorMessage is set to:

The field {0} must be between {1} and {2}.

public RangeAttribute ( double minimum, double maximum ) : System
minimum double Specifies the minimum value allowed for the data field value.
maximum double Specifies the maximum value allowed for the data field value.
Результат System

RangeAttribute() публичный Метод

Initializes a new instance of the System.ComponentModel.DataAnnotations.RangeAttribute class by using the specified minimum and maximum values whose error message is localized.

ErrorMessage is set to:

The field {0} must be between {1} and {2}.

public RangeAttribute ( int minimum, int maximum ) : System
minimum int Specifies the minimum value allowed for the data field value.
maximum int Specifies the maximum value allowed for the data field value.
Результат System

RangeAttribute() публичный Метод

Initializes a new instance of the System.ComponentModel.DataAnnotations.RangeAttribute class by using the specified minimum and maximum values whose error message is localized.
public RangeAttribute ( string errorMessage, Type type, string minimum, string maximum ) : System
errorMessage string An error message to associate with a validation control if validation fails.
type Type Specifies the type of the object to test.
minimum string Specifies the minimum value allowed for the data field value.
maximum string Specifies the maximum value allowed for the data field value.
Результат System

RangeAttribute() публичный Метод

Initializes a new instance of the System.ComponentModel.DataAnnotations.RangeAttribute class by using the specified minimum and maximum values whose error message is localized.
public RangeAttribute ( string errorMessage, double minimum, double maximum ) : System
errorMessage string An error message to associate with a validation control if validation fails.
minimum double Specifies the minimum value allowed for the data field value.
maximum double Specifies the maximum value allowed for the data field value.
Результат System

RangeAttribute() публичный Метод

Initializes a new instance of the System.ComponentModel.DataAnnotations.RangeAttribute class by using the specified minimum and maximum values whose error message is localized.
public RangeAttribute ( string errorMessage, int minimum, int maximum ) : System
errorMessage string An error message to associate with a validation control if validation fails.
minimum int Specifies the minimum value allowed for the data field value.
maximum int Specifies the maximum value allowed for the data field value.
Результат System