Table of Contents

Class CustomValidatorAttribute

Namespace
Exiled.API.Features.Attributes.Validators
Assembly
Exiled.API.dll

Check a value with custom function.

[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
public class CustomValidatorAttribute : Attribute, _Attribute, IValidator
Inheritance
CustomValidatorAttribute
Implements
Inherited Members
Extension Methods

Constructors

CustomValidatorAttribute(Type)

Initializes a new instance of the CustomValidatorAttribute class.

public CustomValidatorAttribute(Type customFunctionType)

Parameters

customFunctionType Type

The type of the custom check validator.

Remarks

The Type from customFunctionType must be a class inheriting IValidator with a parameterless constructor.

Properties

CustomFunctionType

Gets the type of the custom check validator.

public Type CustomFunctionType { get; }

Property Value

Type

ValidatorInstances

Gets a Dictionary<TKey, TValue> from a type inheriting IValidator, to an instance of that class.

public static Dictionary<Type, IValidator> ValidatorInstances { get; }

Property Value

Dictionary<Type, IValidator>

Methods

Check(object)

Checks if other is satisfying this attributes condition.

public bool Check(object other)

Parameters

other object

Value to check.

Returns

bool

Whether the value has passed check.