Show / Hide Table of Contents

Class ValidatorBuilderContext

A model for contextual information about a validator-builder.

Inheritance
System.Object
ValidatorBuilderContext
Implements
IGetsValidationManifest
System.IEquatable<ValidatorBuilderContext>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: CSF.Validation.ValidatorBuilding
Assembly: CSF.Validation.dll
Syntax
public sealed class ValidatorBuilderContext : IGetsValidationManifest, IEquatable<ValidatorBuilderContext>

Constructors

| Improve this Doc View Source

ValidatorBuilderContext(ManifestItem)

Initialises a new instance of ValidatorBuilderContext.

Declaration
public ValidatorBuilderContext(ManifestItem manifestValue)
Parameters
Type Name Description
ManifestItem manifestValue

The manifest value associated with the current context.

Properties

| Improve this Doc View Source

ConfigurationCallbacks

Gets a collection of rule-configuration callbacks for the current instance.

Declaration
public ICollection<IConfiguresContext> ConfigurationCallbacks { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<IConfiguresContext>
| Improve this Doc View Source

Contexts

Gets a collection of contexts contained within the current instance.

Declaration
public ICollection<ValidatorBuilderContext> Contexts { get; }
Property Value
Type Description
System.Collections.Generic.ICollection<ValidatorBuilderContext>
Remarks

It would be wrong to call these "child" contexts, because they might relate to true children (in the nomenclature of Children) but they could also relate to polymorphic types or collection item values. It is better to just think of these as contexts that are to be a part of the ManifestValue in some manner.

| Improve this Doc View Source

IsEligibleToBeRecursive

Gets a value indicating whether or no the current context is eligible to be recursive.

Declaration
public bool IsEligibleToBeRecursive { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ManifestValue

Gets the ManifestItem instance associated with the current context.

Declaration
public ManifestItem ManifestValue { get; }
Property Value
Type Description
ManifestItem

Methods

| Improve this Doc View Source

AssertNotRecursive()

Asserts that the current context is not already recursive. Also marks it ineligible to become recursive.

Declaration
public void AssertNotRecursive()
Exceptions
Type Condition
System.InvalidOperationException

If the current context is already recursive.

| Improve this Doc View Source

Equals(ValidatorBuilderContext)

Determines whether or not the current instance is equal to the specified other or not.

Declaration
public bool Equals(ValidatorBuilderContext other)
Parameters
Type Name Description
ValidatorBuilderContext other

An object to compare with the current instance.

Returns
Type Description
System.Boolean

true if the current instance is equal to the specified object; false otherwise.

| Improve this Doc View Source

Equals(Object)

Determines whether or not the current instance is equal to the specified obj or not.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

An object to compare with the current instance.

Returns
Type Description
System.Boolean

true if the current instance is equal to the specified object; false otherwise.

Overrides
System.Object.Equals(System.Object)
| Improve this Doc View Source

GetContextProvider(Object)

Gets a context provider from the specified object.

Declaration
public static IHasValidationBuilderContext GetContextProvider(object provider)
Parameters
Type Name Description
System.Object provider

An object which must implement IHasValidationBuilderContext.

Returns
Type Description
IHasValidationBuilderContext

A IHasValidationBuilderContext.

Exceptions
Type Condition
System.ArgumentNullException

If the provider is null.

System.ArgumentException

If the provider does not implement IHasValidationBuilderContext.

| Improve this Doc View Source

GetHashCode()

Gets a hash code for the current instance.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A hash code

Overrides
System.Object.GetHashCode()
| Improve this Doc View Source

GetManifest()

Gets a manifest from the current instance.

Declaration
public ValidationManifest GetManifest()
Returns
Type Description
ValidationManifest

A validation manifest.

| Improve this Doc View Source

GetManifestValue()

Gets a manifest value from the current instance.

Declaration
public ManifestItem GetManifestValue()
Returns
Type Description
ManifestItem

A manifest value.

| Improve this Doc View Source

MakeRecursive(ManifestItem)

Converts the current context into a recursive one.

Declaration
public void MakeRecursive(ManifestItem ancestor)
Parameters
Type Name Description
ManifestItem ancestor

The ancestor manifest item into which validation should recurse.

Exceptions
Type Condition
System.InvalidOperationException

If IsEligibleToBeRecursive is false.

| Improve this Doc View Source

RecursivelyConfigure()

Recursively calls all of the ConfigurationCallbacks upon the current context and all of its descendents: Contexts.

Declaration
public void RecursivelyConfigure()
| Improve this Doc View Source

ToString()

Gets a string representation of the current instance.

Declaration
public override string ToString()
Returns
Type Description
System.String

A string representation.

Overrides
System.Object.ToString()

Implements

IGetsValidationManifest
System.IEquatable<T>
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX