Creates a validation error, message, or warning.
Namespace: Microsoft.VisualStudio.Modeling.Validation
Assembly: Microsoft.VisualStudio.Modeling.Sdk (in Microsoft.VisualStudio.Modeling.Sdk.dll)
Syntax
'宣言
Public Function LogViolation ( _
violationType As ViolationType, _
description As String, _
code As String, _
ParamArray elements As ModelElement() _
) As ValidationMessage
'使用
Dim instance As ValidationContext
Dim violationType As ViolationType
Dim description As String
Dim code As String
Dim elements As ModelElement()
Dim returnValue As ValidationMessage
returnValue = instance.LogViolation(violationType, _
description, code, elements)
public ValidationMessage LogViolation(
ViolationType violationType,
string description,
string code,
params ModelElement[] elements
)
public:
ValidationMessage^ LogViolation(
ViolationType violationType,
String^ description,
String^ code,
... array<ModelElement^>^ elements
)
public function LogViolation(
violationType : ViolationType,
description : String,
code : String,
... elements : ModelElement[]
) : ValidationMessage
Parameters
violationType
Type: Microsoft.VisualStudio.Modeling.Validation.ViolationTypeThe type of violation.
description
Type: System.StringA description of the violation.
code
Type: System.StringThe code for the violation.
elements
Type: []The model elements that caused the violation.
Return Value
Type: Microsoft.VisualStudio.Modeling.Validation.ValidationMessage
The validation error, message, or warning.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.