using System; using NodePipeline.Abstractions.Validators; // ReSharper disable UnusedAutoPropertyAccessor.Global namespace NodePipeline.Abstractions.Attributes.Validation.NodeField; //TODO: for analyzer: apply to NodeField, value must be T type where T is integer number [AttributeUsage(AttributeTargets.Property)] public sealed class HasValueBetweenAttribute : Attribute { /// /// Associated with /// /// String min length non-inclusive /// String max length non-inclusive public HasValueBetweenAttribute(decimal min, decimal max) { Min = min; Max = max; } /// /// Associated with /// /// String min length non-inclusive /// String max length non-inclusive public HasValueBetweenAttribute(int min, decimal max) { Min = min; Max = max; } /// /// Associated with /// /// String min length non-inclusive /// String max length non-inclusive public HasValueBetweenAttribute(decimal min, int max) { Min = min; Max = max; } /// /// Associated with /// /// String min length non-inclusive /// String max length non-inclusive public HasValueBetweenAttribute(int min, int max) { Min = min; Max = max; } public decimal? Min { get; } public decimal? Max { get; } } //применить к NodeField, value должно быть типа T, где T – целые числа [AttributeUsage(AttributeTargets.Property)] public sealed class HasMinValueAttribute : Attribute { /// /// Associated with /// /// String min length non-inclusive public HasMinValueAttribute(decimal value) { Value = value; } /// /// Associated with /// /// String min length non-inclusive public HasMinValueAttribute(int value) { Value = value; } public decimal Value { get; } } //применить к NodeField, value должно быть типа T, где T – целые числа [AttributeUsage(AttributeTargets.Property)] public sealed class HasMaxValueAttribute : Attribute { /// /// Associated with /// /// String max length non-inclusive public HasMaxValueAttribute(decimal value) { Value = value; } /// /// Associated with /// /// String max length non-inclusive public HasMaxValueAttribute(int value) { Value = value; } public decimal Value { get; } }