Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PortableClass.cs « PortableClassLibrary « Portable « Samples « NET « Rx - github.com/mono/rx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6b2bfa795ca3835b90b8be0f287deb96e48b4635 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Reactive;
using System.Reactive.Linq;
using System.Reactive.Concurrency;

namespace PortableClassLibrary
{
    public class PortableClass
    {
        public IObservable<long> CreateTimer(int numSamples, TimeSpan timespan)
        {
            var fromTime = DateTimeOffset.Now.Add(timespan);
            return Observable.Timer(fromTime, timespan)
                    .Take(numSamples);
        }

        public IObservable<int> CreateList(IScheduler scheduler)
        {
            var values = new [] {1,2,5,7,8,324,4234,654654};

            return values.ToObservable(scheduler);
        }        
    }
}