LengthAttribute クラス

定義

プロパティで許可されるコレクション/文字列データの最小長と最大長を指定します。

public ref class LengthAttribute : System::ComponentModel::DataAnnotations::ValidationAttribute
[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property, AllowMultiple=false)]
public class LengthAttribute : System.ComponentModel.DataAnnotations.ValidationAttribute
[<System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property, AllowMultiple=false)>]
type LengthAttribute = class
    inherit ValidationAttribute
Public Class LengthAttribute
Inherits ValidationAttribute
継承
属性

コンストラクター

名前 説明
LengthAttribute(Int32, Int32)

プロパティで許可されるコレクション/文字列データの最小長と最大長を指定します。

プロパティ

名前 説明
ErrorMessage

検証が失敗した場合に検証コントロールに関連付けるエラー メッセージを取得または設定します。

(継承元 ValidationAttribute)
ErrorMessageResourceName

検証が失敗した場合に ErrorMessageResourceType プロパティ値を検索するために使用するエラー メッセージ リソース名を取得または設定します。

(継承元 ValidationAttribute)
ErrorMessageResourceType

検証が失敗した場合にエラー メッセージ検索に使用するリソースの種類を取得または設定します。

(継承元 ValidationAttribute)
ErrorMessageString

ローカライズされた検証エラー メッセージを取得します。

(継承元 ValidationAttribute)
MaximumLength

コレクション/文字列データの最大許容長を取得します。

MinimumLength

コレクション/文字列データの許容される最小長を取得します。

RequiresValidationContext

属性に検証コンテキストが必要かどうかを示す値を取得します。

(継承元 ValidationAttribute)
TypeId

派生クラスで実装されている場合は、この Attributeの一意の識別子を取得します。

(継承元 Attribute)

メソッド

名前 説明
Equals(Object)

このインスタンスが指定したオブジェクトと等しいかどうかを示す値を返します。

(継承元 Attribute)
FormatErrorMessage(String)

指定したエラー メッセージに書式を適用します。 ( FormatErrorMessage(String)オーバーライド)

GetHashCode()

このインスタンスのハッシュ コードを返します。

(継承元 Attribute)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
GetValidationResult(Object, ValidationContext)

現在の検証属性に関して、指定した値が有効かどうかを確認します。

(継承元 ValidationAttribute)
IsDefaultAttribute()

派生クラスでオーバーライドされた場合、このインスタンスの値が派生クラスの既定値であるかどうかを示します。

(継承元 Attribute)
IsValid(Object, ValidationContext)

現在の検証属性に関して、指定した値を検証します。

(継承元 ValidationAttribute)
IsValid(Object)

指定したオブジェクトが有効かどうかを判断します。 ( IsValid(Object)オーバーライド)

Match(Object)

派生クラスでオーバーライドされた場合、このインスタンスが指定したオブジェクトと等しいかどうかを示す値を返します。

(継承元 Attribute)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)
Validate(Object, String)

指定したオブジェクトを検証します。

(継承元 ValidationAttribute)
Validate(Object, ValidationContext)

指定したオブジェクトを検証します。

(継承元 ValidationAttribute)

適用対象