本文整理汇总了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());
}
}
}
示例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;
}
示例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);
}