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


C# Flickr.PhotosSearchAsync方法代码示例

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


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

示例1: ShowPic

        public void ShowPic()
        {
            if (CheckNetwork() == true)
            {
                MessageBox.Show("A network connection can not be established.\r\nPlease press refresh or check your network settings.");
                return;
            }
            else
            {
                picList.ItemsSource = "";

                try
                {
                    //to use Flickr go to Project-> Manage NuGet Packages-> Search "Flickr" -> install for windows phone 7


                    Flickr flickr = new Flickr("9a03824af501c318fec232146c6b1d05", "cd5cbd132cfbc60c"); // Authorise by api key and secret
                    PhotoSearchOptions options = new PhotoSearchOptions();
                    options.Tags = App.selectedCountryDetails.CountryCapital.ToString(); //give a key word to search

                    flickr.PhotosSearchAsync(options, (pictures) =>
                    {
                        picList.Dispatcher.BeginInvoke(new Action(delegate()
                        {
                            picList.ItemsSource = pictures.Result; //binding source to listbox
                        }));
                    });
                }
                catch (Exception e)
                {
                    MessageBox.Show("An error occured. Please exit app and try again.\r\nError Details: " + e.Message.ToString());
                }
            }
        }
开发者ID:Chengxuan,项目名称:BThere,代码行数:34,代码来源:FImages.xaml.cs

示例2: MainPage_Loaded

        async void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            var f = new Flickr("3a68f22971d8d66b521b362c312c175c");

            var photos = await f.PhotosSearchAsync(new PhotoSearchOptions { Tags = "colorful", PerPage = 500, SortOrder = PhotoSearchSortOrder.InterestingnessDescending });

            PictureGrid.ItemsSource = photos;
        }
开发者ID:JaswanthDatt,项目名称:flickrnet-samples,代码行数:8,代码来源:MainPage.xaml.cs

示例3: GetPhotos

 private void GetPhotos()
 {
     Flickr flickr = new Flickr("52ae3340d1fbdf56643f44b4f84652fa", "baab02b6bab4f4e7");
     PhotoSearchOptions options = new PhotoSearchOptions();
     options.PerPage = 10;
     options.Text = ItemViewModel.Festival.NameNoSpaces()+" chicago";
     options.Extras |= PhotoSearchExtras.DateTaken;
     flickr.PhotosSearchAsync(options, AssignResult);
 }
开发者ID:kbo4sho,项目名称:FestivalsWP7,代码行数:9,代码来源:DetailPageViewModel.cs


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