ValidationError 构造函数

定义

创建 ValidationError 类的新实例。Creates a new instance of a ValidationError class.

重载

ValidationError(String)

使用指定的错误消息创建 ValidationError 类的新实例。Creates a new instance of the ValidationError class using the specified error message.

ValidationError(String, Boolean)

使用指定的错误消息和警告指示创建 ValidationError 类的新实例。Creates a new instance of the ValidationError class using the specified error message and warning indication.

ValidationError(String, Boolean, String)

使用指定的错误消息、警告指示器和导致错误的属性的名称创建 ValidationError 类的新实例。Creates a new instance of the ValidationError class using the specified error message, warning indicator, and name of the property that caused the error.

ValidationError(String, Boolean, String, Object)

使用指定的错误消息、警告指示器、属性名称和导致错误的源细节创建 ValidationError 类的新实例。Creates a new instance of the ValidationError class using the specified error message, warning indicator, name of the property and the source detail that caused the error.

ValidationError(String)

使用指定的错误消息创建 ValidationError 类的新实例。Creates a new instance of the ValidationError class using the specified error message.

public:
 ValidationError(System::String ^ message);
public ValidationError (string message);
new System.Activities.Validation.ValidationError : string -> System.Activities.Validation.ValidationError
Public Sub New (message As String)

参数

message
String

有关错误的信息。The information about the error.

适用于

ValidationError(String, Boolean)

使用指定的错误消息和警告指示创建 ValidationError 类的新实例。Creates a new instance of the ValidationError class using the specified error message and warning indication.

public:
 ValidationError(System::String ^ message, bool isWarning);
public ValidationError (string message, bool isWarning);
new System.Activities.Validation.ValidationError : string * bool -> System.Activities.Validation.ValidationError
Public Sub New (message As String, isWarning As Boolean)

参数

message
String

错误消息。The error message.

isWarning
Boolean

如果错误是警告,则为 true;否则为 falsetrue if the error is a warning; otherwise, false.

适用于

ValidationError(String, Boolean, String)

使用指定的错误消息、警告指示器和导致错误的属性的名称创建 ValidationError 类的新实例。Creates a new instance of the ValidationError class using the specified error message, warning indicator, and name of the property that caused the error.

public:
 ValidationError(System::String ^ message, bool isWarning, System::String ^ propertyName);
public ValidationError (string message, bool isWarning, string propertyName);
new System.Activities.Validation.ValidationError : string * bool * string -> System.Activities.Validation.ValidationError
Public Sub New (message As String, isWarning As Boolean, propertyName As String)

参数

message
String

错误消息。The error message.

isWarning
Boolean

指示错误是否为警告的指示器。An indicator whether the error is a warning.

propertyName
String

生成错误的属性的字母数字名称。The alphanumeric name of the property that generated the error.

适用于

ValidationError(String, Boolean, String, Object)

使用指定的错误消息、警告指示器、属性名称和导致错误的源细节创建 ValidationError 类的新实例。Creates a new instance of the ValidationError class using the specified error message, warning indicator, name of the property and the source detail that caused the error.

public:
 ValidationError(System::String ^ message, bool isWarning, System::String ^ propertyName, System::Object ^ sourceDetail);
public ValidationError (string message, bool isWarning, string propertyName, object sourceDetail);
new System.Activities.Validation.ValidationError : string * bool * string * obj -> System.Activities.Validation.ValidationError
Public Sub New (message As String, isWarning As Boolean, propertyName As String, sourceDetail As Object)

参数

message
String

错误消息。The error message.

isWarning
Boolean

指示错误是否为警告的指示器。An indicator whether the error is a warning.

propertyName
String

生成错误的属性的字母数字名称。The alphanumeric name of the property that generated the error.

sourceDetail
Object

有关该错误源的详细信息。The detail about the source of the error.

适用于