Compartilhar via


ValidationContext Class

Definition

Context for validating model elements. The constructor will take a collection of model elements intended to be validated. Once the validaiton is done, the validation message will be staged in the CurrentViolations property.

public ref class ValidationContext
public class ValidationContext
type ValidationContext = class
Public Class ValidationContext
Inheritance
ValidationContext
Derived

Constructors

ValidationContext(String[], IEnumerable<ModelElement>)

Ctor

ValidationContext(String[], ModelElement)

Ctor for creating a custom validation context. The validation can then be called from ValidationController.Validate with this context object.

ValidationContext(ValidationCategories, IEnumerable<ModelElement>)

Constructor

ValidationContext(ValidationCategories, ModelElement)

Constructor

Properties

Categories

Returns the validation context.

CurrentViolations

Returns the readonly collection of reported validation messages.

CustomCategories

Returns the custom validation strings user specified via ValidationController.ValidateCustom API

ValidationSubjects

Get the read only collection of ModelElements to be validated.

Methods

ConstructValidationMessage(String, String, ViolationType, ModelElement[])

Construct a validation message. Override this method to construct a custom validation message.

GetCache<T>()

Get the Cache object of a given class. Constructs an object if none already exists in this ValidationContext.

GetCache<T>(String)

Get a Cache object of a given class and name. Constructs an object if none already exists in this ValidationContext.

GetNavigationProxyModelElements(ModelElement)

Returns the substitutes model element for the passed in model element. Consider the case where the viewed presentation model element(s) (PELs) represents the model element(s) which are proxies to the actual offending model element reported during the model validation.

LogError(String, String, ModelElement[])

Create a new validation error and log a message into the collection maintained by the validation context

LogFatal(String, String, ModelElement[])

Create a new validation fatal error and log a message into the collection maintained by the validation context

LogMessage(String, String, ModelElement[])

Create a new validation information and log a message into the collection maintained by the validation context

LogViolation(ViolationType, String, String, ModelElement[])

Create a new validation error, message or warning based on passed in violationType enum value. The validation message into the collection maintained by the validation context

LogWarning(String, String, ModelElement[])

Create a new validation warning and log a message into the collection maintained by the validation context

SetCacheValue<T>(String, T)

Set the cached object associated with the name

TryGetCacheValue<T>(String, T)

Returns whether the cached object associated with the name exist or not

Applies to