상속: IRandomAccessStream
예제 #1
0
        public IObservable <BitmapImage> FetchImageForAlbum(Song song)
        {
            var rq = rqFactory(HttpMethod.Get, String.Format("images/art/{0}.png", song.id));

            return(client.RequestAsync(rq)
                   .SelectMany(x => x.Content.ReadAsByteArrayAsync())
                   .ObserveOn(RxApp.DeferredScheduler)
                   .SelectMany(x => {
                var ret = new BitmapImage();
                var mem = new MemoryRandomAccessStream(x);
                return ret.SetSourceAsync(mem).ToObservable().Select(_ => ret);
            }));
        }
예제 #2
0
파일: PlayApi.cs 프로젝트: play/play-win8
 public IObservable<BitmapImage> FetchImageForAlbum(Song song)
 {
     var rq = rqFactory(HttpMethod.Get, String.Format("images/art/{0}.png", song.id));
     return client.RequestAsync(rq)
         .SelectMany(x => x.Content.ReadAsByteArrayAsync())
         .ObserveOn(RxApp.DeferredScheduler)
         .SelectMany(x => {
                 var ret = new BitmapImage();
                 var mem = new MemoryRandomAccessStream(x);
                 return ret.SetSourceAsync(mem).ToObservable().Select(_ => ret);
         });
 }