示例#1
0
        private void SearchButton_Click(object sender, RoutedEventArgs e)
        {
            Flickr f = FlickrManager.GetAuthInstance();

            PhotoSearchOptions options = new PhotoSearchOptions();

            options.Tags   = SearchTextBox.Text;
            options.Extras = PhotoSearchExtras.LargeSquareUrl;

            f.PhotosSearchAsync(options, r =>
            {
                if (r.Error != null)
                {
                    Dispatcher.BeginInvoke(() =>
                    {
                        MessageBox.Show("An error occurred talking to Flickr: " + r.Error.Message);
                    });
                    return;
                }

                PhotoCollection photos = r.Result;

                Dispatcher.BeginInvoke(() =>
                {
                    ResultsListBox.ItemsSource = photos;
                });
            });
        }
示例#2
0
        private void UploadButton_OnClick(object sender, RoutedEventArgs e)
        {
            var f = FlickrManager.GetAuthInstance();

            //Stream fileStream = new FileStream(_photoFilename, FileMode.Open);
            _startingMemoryUsage = DeviceStatus.ApplicationCurrentMemoryUsage;
            f.UploadPictureAsync(_photoStream, "photo.jpg", Title.Text, null, null, false, false, false, ContentType.Photo, SafetyLevel.None, HiddenFromSearch.None, UploadComplete);
        }