Beispiel #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;
Beispiel #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;
Beispiel #3
0
 public static RangeBoundaryFrom <T> BoundaryFromExclusive <T>(T fromValue) =>
 RangeBoundaryFrom <T> .AdjustAndCreate(fromValue, RangeBoundaryFromKind.Exclusive);
Beispiel #4
0
 internal static RangeBoundaryFrom <T> GetCompareToBoundary <T>(T value) =>
 RangeBoundaryFrom <T> .AdjustAndCreate(value, RangeBoundaryFromKind.Inclusive);