private protected override void ValidateSet(T value) { if (!EnumStringLookup <T> .IsDefined(value)) { throw new ArgumentOutOfRangeException(nameof(value), ExceptionMessages.InvalidEnumValue); } }
/// <inheritdoc /> internal override bool IsInVersion(FileFormatVersions fileFormat) { Debug.Assert(HasValue); var supportedVersion = EnumStringLookup <T> .GetVersion(Value); return(supportedVersion.Includes(fileFormat)); }
private protected override T Parse(string input) { if (EnumStringLookup <T> .TryParse(input, out var value)) { return(value); } throw new FormatException(ExceptionMessages.TextIsInvalidEnumValue); }
private protected override bool TryParse(string input, out T value) => EnumStringLookup <T> .TryParse(input, out value);
private protected override string GetText(T input) => EnumStringLookup <T> .ToString(input);