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

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

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

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

Applies formatting to a specified error message.

StringLengthAttribute ( int maximumLength ) : System

Initializes a new instance of the System.ComponentModel.DataAnnotations.StringLengthAttribute class by using a specified maximum length whose error message is localized.

ErrorMessage is set to:

The {0} must be at least {2} characters long.

StringLengthAttribute ( int maximumLength, int minLength ) : System

Initializes a new instance of the System.ComponentModel.DataAnnotations.StringLengthAttribute class by using a specified maximum length whose error message is localized.

ErrorMessage is set to:

The {0} must be at least {2} characters long but no longer than {1} characters.

StringLengthAttribute ( string errorMessage, int maximumLength ) : System

Initializes a new instance of the System.ComponentModel.DataAnnotations.StringLengthAttribute class by using a specified maximum length whose error message is localized.

StringLengthAttribute ( string errorMessage, int maximumLength, int minLenght ) : System

Initializes a new instance of the System.ComponentModel.DataAnnotations.StringLengthAttribute class by using a specified maximum length whose error message is localized.

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

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

Applies formatting to a specified error message.
public FormatErrorMessage ( string name ) : string
name string The name of the field that caused the validation failure.
Результат string

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

Initializes a new instance of the System.ComponentModel.DataAnnotations.StringLengthAttribute class by using a specified maximum length whose error message is localized.

ErrorMessage is set to:

The {0} must be at least {2} characters long.

public StringLengthAttribute ( int maximumLength ) : System
maximumLength int The maximum length of a string.
Результат System

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

Initializes a new instance of the System.ComponentModel.DataAnnotations.StringLengthAttribute class by using a specified maximum length whose error message is localized.

ErrorMessage is set to:

The {0} must be at least {2} characters long but no longer than {1} characters.

public StringLengthAttribute ( int maximumLength, int minLength ) : System
maximumLength int The maximum length of a string.
minLength int The minimum length of the string.
Результат System

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

Initializes a new instance of the System.ComponentModel.DataAnnotations.StringLengthAttribute class by using a specified maximum length whose error message is localized.
public StringLengthAttribute ( string errorMessage, int maximumLength ) : System
errorMessage string An error message to associate with a validation control if validation fails.
maximumLength int The maximum length of a string.
Результат System

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

Initializes a new instance of the System.ComponentModel.DataAnnotations.StringLengthAttribute class by using a specified maximum length whose error message is localized.
public StringLengthAttribute ( string errorMessage, int maximumLength, int minLenght ) : System
errorMessage string An error message to associate with a validation control if validation fails.
maximumLength int The maximum length of a string.
minLenght int The minimum length of a string.
Результат System