Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }