Esempio n. 1
0
 public bool Equals(MultiRange other)
 {
     if (other is null)
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Count == other.Count && ranges.SequenceEqual(other.ranges));
 }
Esempio n. 2
0
        public void UnionWith(MultiRange other)
        {
            if (ranges.Count == 0)
            {
                Count = other.Count;
                ranges.AddRange(other.ranges);
                return;
            }

            Count += other.Count;
            ranges.AddRange(other.ranges);
            ranges.Sort();
            Merge();
        }
Esempio n. 3
0
 public MultiRange(MultiRange source)
 {
     Count = source.Count;
     ranges.AddRange(source.ranges);
 }