Beispiel #1
0
 private protected override void ValidateSet(T value)
 {
     if (!EnumInfoLookup <T> .IsDefined(value))
     {
         throw new ArgumentOutOfRangeException(nameof(value), ExceptionMessages.InvalidEnumValue);
     }
 }
Beispiel #2
0
        private protected override T Parse(string?input)
        {
            if (EnumInfoLookup <T> .TryParse(input, out var value))
            {
                return(value);
            }

            throw new FormatException(ExceptionMessages.TextIsInvalidEnumValue);
        }
Beispiel #3
0
        /// <inheritdoc />
        internal override bool IsInVersion(FileFormatVersions fileFormat)
        {
            Debug.Assert(HasValue);

            return(fileFormat.AtLeast(EnumInfoLookup <T> .GetVersion(Value)));
        }
Beispiel #4
0
 private protected override bool TryParse(string?input, out T value) => EnumInfoLookup <T> .TryParse(input, out value);
Beispiel #5
0
 private protected override string GetText(T input) => EnumInfoLookup <T> .ToString(input);