/// <summary>
        /// Determines whether the current <see cref="T:Academy.Collections.Generic.ReadOnlySortedSet`1"/> is a proper (strict) superset of a specified collection.
        /// </summary>
        /// <param name="other">The collection to compare to the current set.</param>
        /// <returns>true if the current <see cref="T:Academy.Collections.Generic.ReadOnlySortedSet"/> is a proper superset of <paramref name="other"/>; otherwise, false.</returns>
        public bool IsProperSupersetOf(IEnumerable <T> other)
        {
            if (other == null)
            {
                Thrower.ArgumentNullException(ArgumentType.other);
            }
            if (Count == 0)
            {
                return(false);
            }
            ICommonSortedSet <T> sortedset = SetHelper <T> .GetSortedSetIfSameComparer(this, Comparer);

            if (sortedset != null)
            {
                if (sortedset.Count >= Count)
                {
                    return(false);
                }
                ReadOnlySortedSet <T> subset = this.GetViewBetween(sortedset.MinValue, sortedset.MaxValue);
                foreach (T item in sortedset)
                {
                    if (subset.Contains(item))
                    {
                        return(false);
                    }
                }
                return(true);
            }
            return(SetHelper <T> .IsProperSubsetOf(this, other));
        }
 public SubSetView(ReadOnlySortedSet <T> collection, int lowerIndex, int upperIndex)
 {
     this._underlying = collection;
     this._lowerIndex = lowerIndex;
     this._upperIndex = upperIndex;
     this._comparer   = collection._comparer;
     this._elements   = collection._elements;
 }
 public void OnDeserialization(object sender)
 {
     if (_sinfo != null)
     {
         this._underlying = (ReadOnlySortedSet <T>)_sinfo.GetValue(SerializationString.Collection, typeof(ReadOnlySortedSet <T>));
         this._lowerIndex = _sinfo.GetInt32(SerializationString.LowerIndex);
         this._upperIndex = _sinfo.GetInt32(SerializationString.UpperIndex);
         this._elements   = _underlying._elements;
         this._comparer   = _underlying._comparer;
     }
 }
        /// <summary>
        /// Determines whether the current <see cref="T:Academy.Collections.Generic.ReadOnlySortedSet`1"/> is a superset of a specified collection.
        /// </summary>
        /// <param name="other">The collection to compare to the current set.</param>
        /// <returns>true if the current <see cref="T:Academy.Collections.Generic.ReadOnlySortedSet`1"/> is a superset of <paramref name="other"/>; otherwise, false.</returns>
        public bool IsSupersetOf(IEnumerable <T> other)
        {
            if (other == null)
            {
                Thrower.ArgumentNullException(ArgumentType.other);
            }
            if (CollectionHelper.IsWellKnownCollection(other, out int num))
            {
                if (num == 0)
                {
                    return(true);
                }
                if (SetHelper <T> .IsWellKnownSet(other))
                {
                    if (this.Count < num)
                    {
                        return(false);
                    }
                }
            }
            ICommonSortedSet <T> sortedset = SetHelper <T> .GetSortedSet(other);

            if ((sortedset == null) || !AreEqualComparers(this._comparer, sortedset.Comparer))
            {
                return(this.ContainsSequence(other));
            }
            ReadOnlySortedSet <T> subset = this.GetViewBetween(sortedset.MinValue, sortedset.MaxValue);

            foreach (T item in sortedset)
            {
                if (!subset.Contains(item))
                {
                    return(false);
                }
            }
            return(true);
        }
 internal Enumerator(ReadOnlySortedSet <T> set)
 {
     this.set     = set;
     this.current = default(T);
     this.index   = set.StartIndex;
 }