protected override bool InternalInRange(RFInterval interval) { var isAllowed = (AllowRanges.Count == 0 || AllowRanges.Any(r => r.InRange(interval))); var isDenied = (DenyRanges.Count > 0 && DenyRanges.Any(r => r.InRange(interval))); var isExplicit = (ExplicitRanges.Count == 0 || ExplicitRanges.All(r => r.InRange(interval))); return(isAllowed && !isDenied && isExplicit); }
public override string ToString() { var sb = new List <string>(); if (AllowRanges.Any()) { sb.Add(String.Join(" & ", AllowRanges)); } if (DenyRanges.Any()) { sb.Add(String.Format("Except {0}", String.Join(" & ", DenyRanges))); } if (ExplicitRanges.Any()) { sb.Add(String.Format("On {0}", String.Join(" & ", ExplicitRanges))); } return(string.Join(", ", sb)); }