public static IObservable <T> Skip <T>(this IObservable <T> source, TimeSpan duration, IScheduler scheduler)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (scheduler == null)
            {
                throw new ArgumentNullException("scheduler");
            }

            // optimize .Skip(duration).Skip(duration)
            SkipObservable <T> skip = source as SkipObservable <T>;

            if (skip != null && skip.scheduler == scheduler)
            {
                return(skip.Combine(duration));
            }

            return(new SkipObservable <T>(source, duration, scheduler));
        }
        public static IObservable <T> Skip <T>(this IObservable <T> source, int count)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            if (count < 0)
            {
                throw new ArgumentOutOfRangeException("count");
            }

            // optimize .Skip(count).Skip(count)
            SkipObservable <T> skip = source as SkipObservable <T>;

            if (skip != null && skip.scheduler == null)
            {
                return(skip.Combine(count));
            }

            return(new SkipObservable <T>(source, count));
        }
示例#3
0
 public Skip(SkipObservable <T> parent, IObserver <T> observer, IDisposable cancel) : base(observer, cancel)
 {
     this.remaining = parent.count;
 }
示例#4
0
 public Skip_(SkipObservable <T> parent, IObserver <T> observer, IDisposable cancel) : base(observer, cancel)
 {
     this.parent = parent;
 }