| | | 1 | | namespace Pozitron.QuerySpecification; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Specifies whether auto discovery for evaluators and validators is enabled. |
| | | 5 | | /// </summary> |
| | | 6 | | [AttributeUsage(AttributeTargets.Assembly)] |
| | | 7 | | public sealed class SpecAutoDiscoveryAttribute : Attribute |
| | | 8 | | { |
| | | 9 | | /// <summary> |
| | | 10 | | /// Gets the value indicating whether auto discovery is enabled. |
| | | 11 | | /// </summary> |
| | 1 | 12 | | public string Value { get; } |
| | | 13 | | |
| | | 14 | | /// <summary> |
| | | 15 | | /// Defines a SpecAutoDiscoveryAttribute to enable or disable auto discovery. |
| | | 16 | | /// </summary> |
| | | 17 | | /// <param name="value">The value indicating whether auto discovery is enabled.</param> |
| | 1 | 18 | | public SpecAutoDiscoveryAttribute(string value) |
| | | 19 | | { |
| | 1 | 20 | | Value = value; |
| | 1 | 21 | | } |
| | | 22 | | } |
| | | 23 | | |
| | | 24 | | /// <summary> |
| | | 25 | | /// Specifies discovery options for evaluators and validators, such as the order and whether discovery is enabled. |
| | | 26 | | /// </summary> |
| | | 27 | | [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] |
| | | 28 | | public class DiscoveryAttribute : Attribute |
| | | 29 | | { |
| | | 30 | | /// <summary> |
| | | 31 | | /// Gets the order in which the evaluator/validator should be applied. Lower values are applied first. |
| | | 32 | | /// </summary> |
| | | 33 | | public int Order { get; set; } = int.MaxValue; |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Gets a value indicating whether the evaluator/validator is discoverable. |
| | | 37 | | /// </summary> |
| | | 38 | | public bool Enable { get; set; } = true; |
| | | 39 | | } |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// Specifies discovery options for evaluators, such as the order and whether discovery is enabled. |
| | | 43 | | /// </summary> |
| | | 44 | | public sealed class EvaluatorDiscoveryAttribute : DiscoveryAttribute |
| | | 45 | | { |
| | | 46 | | } |
| | | 47 | | |
| | | 48 | | /// <summary> |
| | | 49 | | /// Specifies discovery options for validators, such as the order and whether discovery is enabled. |
| | | 50 | | /// </summary> |
| | | 51 | | public sealed class ValidatorDiscoveryAttribute : DiscoveryAttribute |
| | | 52 | | { |
| | | 53 | | } |