ValidationMessage Class
Represents a validation message that states an error, a warning, or a message.
Inheritance Hierarchy
System.Object
Microsoft.VisualStudio.Modeling.Validation.ValidationMessage
Microsoft.VisualStudio.Modeling.Shell.TaskValidationMessage
Namespace: Microsoft.VisualStudio.Modeling.Validation
Assembly: Microsoft.VisualStudio.Modeling.Sdk.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.10.0.dll)
Syntax
'宣告
Public Class ValidationMessage
public class ValidationMessage
public ref class ValidationMessage
type ValidationMessage = class end
public class ValidationMessage
The ValidationMessage type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ValidationMessage(ValidationContext, String) | Initializes a new instance of the ValidationMessage class using a context and a description for the message. | |
ValidationMessage(ValidationContext, String, Int32, Int32) | Initializes a new instance of the ValidationMessage class using a context, a description, a line number, and a column number for the message. | |
ValidationMessage(ValidationContext, String, String, ViolationType) | Initializes a new instance of the ValidationMessage class using a context, a description, a code, and a violation type for the message. |
Top
Properties
Name | Description | |
---|---|---|
Code | Gets the code for the message. | |
Column | Gets the column in a line of text where the error occurs. | |
Context | Gets the context information for a validation message. | |
Description | Gets the description for a validation message. | |
File | Gets the name of a referenced file. | |
HelpKeyword | Gets or sets the keyword to search for in the Help for Visual Studio. | |
Line | Gets the line number in the file to which the error or the warning refers. | |
ReferencedFiles | Gets the names of files to which the ValidationMessage refers. | |
ReferencedModelElements | Gets the model elements that are referenced by this message. | |
Type | Gets the type of validation message. |
Top
Methods
Name | Description | |
---|---|---|
Equals | Checks to see whether the validation message is equal to another object. (Overrides Object.Equals(Object).) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Gets an identifier for a ValidationMessage. (Overrides Object.GetHashCode().) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Identifies the validation message. (Overrides Object.ToString().) | |
UpdateFileReferences(IEnumerable<String>) | Contains the names of files to update from a list of zero or more file names. | |
UpdateFileReferences(String) | Contains the name of the file to update. | |
UpdateReferencedModelElements | Updates the referenced model elements. |
Top
Remarks
A ValidationMessage is created in a user-defined validation method. The actual creation is completed through the virtual ValidationContext.ConstructValidationMessage method.
This class represents validation messages that the ValidationMessageObserver class can obtain.
For more information, see Validation in a Domain-Specific Language.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.