Esempio 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;
Esempio 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;
Esempio n. 3
0
 public static RangeBoundaryTo <T> BoundaryToExclusive <T>(T toValue) =>
 RangeBoundaryTo <T> .AdjustAndCreate(toValue, RangeBoundaryToKind.Exclusive);