TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class Validator in Tinman.Core.Validating

Utility class for validating object graphs and reporting error and warning messages.

sealed class Validator extends EnumerableBase<IValidateMessage>
  implements IVersioned

Public / Attributes

HasErrors

Have there been any errors during validation so far?

public property HasErrors { get }
type bool
value true if there is at least one error, false if not.

HasMessages

Have there been any messages (errors / warnings) during validation so far?

public property HasMessages { get }
type bool
value true if there is at least one error or warning, false if not.

HasWarnings

Have there been any warnings during validation so far?

public property HasWarnings { get }
type bool
value true if there is at least one warning, false if not.

Result

Returns the current validation result.

public property Result { get }
type ValidateResult
value The validation result.

Version

Returns the current version of object.

public property Version { get }
type int32
value The current version number.
implements IVersioned.Version

Remarks:

For each modification, the version is incremented by at least one.

Public / Constructors

Validator

Creates a new instance of Validator.

public constructor Validator ()

Public / Methods

BeginContext

Uses the given context object for subsequent validation.

public method BeginContext (object context)
params context The context object.

See also:

End

BeginEntry

A dictionary entry of the current value is about to be validated.

public method BeginEntry (string key, ICodeRange culprit = null)
params key [not-empty] The entry key.
  culprit The object to report as the culprit if subsequent validation fails. Defaults to null.

See also:

End

BeginIndex

An array element of the current value is about to be validated.

public method BeginIndex (int32 index, ICodeRange culprit = null)
params index [>=0] The array index.
  culprit The object to report as the culprit if subsequent validation fails. Defaults to null.

See also:

End

BeginMember

A named member of the current value is about to be validated.

public method BeginMember (string name, ICodeRange culprit = null)
params name [not-empty] The member name.
  culprit The object to report as the culprit if subsequent validation fails. Defaults to null.

See also:

End

End

Validation of the most recent element has finished.

public method End ()

See also:

BeginContext
BeginIndex
BeginEntry
BeginMember

GetEnumerator

public override method GetEnumerator ()
type IEnumerator<IValidateMessage>
implements EnumerableBase.GetEnumerator

Message

Emits a validation message.

public method Message (IValidateMessage message)
params message [not-null] The message.

MessageEntry

Emits a validation message for a dictionary entry.

public method MessageEntry (string key, IValidateMessage message, ICodeRange culprit = null)
params key [not-empty] The entry key.
  message [not-null] The message.
  culprit The object to report as the culprit for the message. Defaults to null.

See also:

BeginEntry

MessageIndex

Emits a validation message for an array element.

public method MessageIndex (int32 index, IValidateMessage message, ICodeRange culprit = null)
params index [>=0] The element index.
  message [not-null] The message
  culprit The object to report as the culprit for the message. Defaults to null.

See also:

BeginIndex

MessageMember

Emits a validation message for a named member.

public method MessageMember (string name, IValidateMessage message, ICodeRange culprit = null)
params name [not-empty] The member name.
  message [not-null] The message
  culprit The object to report as the culprit for the message. Defaults to null.

Messages

Emits validation messages.

public method Messages (ValidateResult result)
params result The validation result.

Emits validation messages.

public method Messages (IEnumerable<IValidateMessage> messages)
params messages The messages or null.