当前位置: 首页>>代码示例>>C#>>正文


C# IImageService.GetImages方法代码示例

本文整理汇总了C#中IImageService.GetImages方法的典型用法代码示例。如果您正苦于以下问题:C# IImageService.GetImages方法的具体用法?C# IImageService.GetImages怎么用?C# IImageService.GetImages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IImageService的用法示例。


在下文中一共展示了IImageService.GetImages方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FlickrSearchViewModel

        public FlickrSearchViewModel(IImageService imageService)
        {
            Images = new ReactiveList<SearchResultViewModel>();

            var canExecute = this.WhenAnyValue(x => x.SearchText)
                .Select(x => !String.IsNullOrWhiteSpace(x));

            Search = ReactiveCommand.CreateAsyncObservable(
                canExecute,
                _ =>
                {
                    Images.Clear();
                    ShowError = false;
                    return imageService.GetImages(SearchText);
                });

            Search.Subscribe(images => Images.Add(images));

            Search.ThrownExceptions.Subscribe(_ => ShowError = true);

            isLoading = Search.IsExecuting.ToProperty(this, vm => vm.IsLoading);

            canEnterSearchText = this.WhenAnyValue(x => x.IsLoading)
                .Select(x => !x)
                .ToProperty(this, vm => vm.CanEnterSearchText);
        }
开发者ID:reactiveui-forks,项目名称:ReactiveFlickr,代码行数:26,代码来源:FlickrSearchViewModel.cs

示例2: SetUp

            public void SetUp()
            {
                service = Substitute.For<IImageService>();
                service.GetImages(Arg.Any<string>())
                    .Returns(Observable.Never<SearchResultViewModel>());

                subject = new FlickrSearchViewModel(service);
            }
开发者ID:reactiveui-forks,项目名称:ReactiveFlickr,代码行数:8,代码来源:FlickrSearchViewModelTests.cs

示例3: CreateSearchCommand

        private void CreateSearchCommand(IImageService imageService)
        {
            var canExecute = this.WhenAnyValue(x => x.SearchText)
                .Select(x => !String.IsNullOrEmpty(x));

            Search = ReactiveCommand.CreateAsyncObservable(canExecute,
                _ =>
                {
                    Images.Clear();
                    ShowError = false;
                    return imageService.GetImages(SearchText);
                });

            Search.Subscribe(images => Images.Add(images));
            Search.ThrownExceptions.Subscribe(_ => ShowError = true);
        }
开发者ID:SaberZA,项目名称:RxTest,代码行数:16,代码来源:FlickrSearchViewModel.cs


注:本文中的IImageService.GetImages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。