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
customFunctionTypeTypeThe 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
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
Methods
Check(object)
Checks if other is satisfying this attributes condition.
public bool Check(object other)
Parameters
otherobjectValue to check.
Returns
- bool
Whether the value has passed check.