Exemplo n.º 1
0
 private static Range <T> TryCreateCore <T>(
     T from, RangeBoundaryFromKind fromKind,
     T to, RangeBoundaryToKind toKind) =>
 RangeBoundaryFrom <T> .IsValid(from) && RangeBoundaryTo <T> .IsValid(to)
                                 ? TryCreate(
     RangeBoundaryFrom <T> .AdjustAndCreate(from, fromKind),
     RangeBoundaryTo <T> .AdjustAndCreate(to, toKind))
                                 : Range <T> .Empty;
Exemplo n.º 2
0
        private static Range <T> TryCreateCore <T>(
            T from, RangeBoundaryFromKind fromKind,
            T to, RangeBoundaryToKind toKind) =>
        IsValid(from, to)
#pragma warning disable 618 // Validation not required: IsValid() called.
                                        ? new Range <T>(
            RangeBoundaryFrom <T> .AdjustAndCreate(from, fromKind),
            RangeBoundaryTo <T> .AdjustAndCreate(to, toKind),
            SkipsArgValidation)
#pragma warning restore 618
                                        : Range <T> .Empty;
Exemplo n.º 3
0
 public static RangeBoundaryFrom <T> BoundaryFromExclusive <T>(T fromValue) =>
 RangeBoundaryFrom <T> .AdjustAndCreate(fromValue, RangeBoundaryFromKind.Exclusive);
Exemplo n.º 4
0
 internal static RangeBoundaryFrom <T> GetCompareToBoundary <T>(T value) =>
 RangeBoundaryFrom <T> .AdjustAndCreate(value, RangeBoundaryFromKind.Inclusive);