ContractLocalizedTextProvider Class |
PostSharp.Patterns.Utilities.LocalizedTextProvider
PostSharp.Patterns.Contracts.ContractLocalizedTextProvider
Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.6.14.0 (6.6.14.0)
public class ContractLocalizedTextProvider : LocalizedTextProvider
The ContractLocalizedTextProvider type exposes the following members.
Name | Description | |
---|---|---|
ContractLocalizedTextProvider |
Initializes a new ContractLocalizedTextProvider.
|
Name | Description | |
---|---|---|
Current | Obsolete.
Current instance of ContractLocalizedTextProvider.
|
Name | Description | |
---|---|---|
FormatString |
Formats a string. An implementation would typically invoke Format(String, Object[]).
(Inherited from LocalizedTextProvider.) | |
GetFormattedMessage |
Gets a message template using GetMessage(String) and formats it using the values in exceptionInfo.
| |
GetFormattingStringArguments |
Returns an array of arguments that can be passed to the Format(String, Object[]) method
| |
GetMessage |
Gets a message declared by the LocalizedTextProvider or the rest of responsibility chain if applicable.
(Overrides LocalizedTextProvider.GetMessage(String).) |
Name | Description | |
---|---|---|
CreditCardErrorMessage |
Identifier of the error message shown when CreditCardAttribute constraint is violated.
| |
EmailAddressErrorMessage |
Identifier of the error message shown when EmailAddressAttribute constraint is violated.
| |
EnumDataTypeErrorMessage |
Identifier of the error message shown when EnumDataTypeAttribute constraint is violated.
| |
GreaterThanErrorMessage |
Identifier of the error message shown when GreaterThanAttribute constraint is violated.
| |
LessThanErrorMessage |
Identifier of the error message shown when LessThanAttribute constraint is violated.
| |
LocationContractErrorMessage |
Identifier of the error message shown when LocationContractAttribute constraint is violated.
| |
NotEmptyErrorMessage |
Identifier of the error message shown when NotEmptyAttribute constraint is violated.
| |
NotNullErrorMessage |
Identifier of the error message shown when NotNullAttribute constraint is violated.
| |
PhoneErrorMessage |
Identifier of the error message shown when PhoneAttribute constraint is violated.
| |
RangeErrorMessage |
Identifier of the error message shown when RangeAttribute constraint is violated.
| |
RegularExpressionErrorMessage |
Identifier of the error message shown when RegularExpressionAttribute constraint is violated.
| |
RequiredErrorMessage |
Identifier of the error message shown when RequiredAttribute constraint is violated.
| |
StrictlyGreaterThanErrorMessage |
Identifier of the error message shown when StrictlyGreaterThanAttribute constraint is violated.
| |
StrictlyLessThanErrorMessage |
Identifier of the error message shown when StrictlyLessThanAttribute constraint is violated.
| |
StrictRangeErrorMessage |
Identifier of the error message shown when RangeAttribute constraint is violated.
| |
StringLengthMaxErrorMessage |
Identifier of the error message shown when StringLengthAttribute constraint is violated (only maximum length was specified).
| |
StringLengthMinErrorMessage |
Identifier of the error message shown when StringLengthAttribute constraint is violated (only minimum length was specified).
| |
StringLengthRangeErrorMessage |
Identifier of the error message shown when StringLengthAttribute constraint is violated (both minimum and maximum was specified).
| |
UrlErrorMessage |
Identifier of the error message shown when UrlAttribute constraint is violated.
|
An implementation would typically override the GetMessage(String) method. This method returns a formatting string where first 4 parameters have a well-known signification:
Parameter | Description |
---|---|
{0} | Name of the declaration being validated (empty in case of return value). |
{1} | Kind of the declaration being validated. |
{2} | Name and kind of the declaration being validated. |
{3} | The invalid value. |