コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Flickr f = FlickrManager.GetInstance();

            PhotoSearchOptions o = new PhotoSearchOptions();

            o.Extras    = PhotoSearchExtras.AllUrls | PhotoSearchExtras.Description | PhotoSearchExtras.OwnerName;
            o.SortOrder = PhotoSearchSortOrder.Relevance;
            o.Tags      = textBox1.Text;

            bindingSource1.DataSource = f.PhotosSearch(o);
        }
コード例 #2
0
        private void AuthenticateButton_Click(object sender, EventArgs e)
        {
            Flickr f = FlickrManager.GetInstance();

            requestToken = f.OAuthGetRequestToken("oob");

            string url = f.OAuthCalculateAuthorizationUrl(requestToken.Token, AuthLevel.Write);

            System.Diagnostics.Process.Start(url);

            Step2GroupBox.Enabled = true;
        }
コード例 #3
0
        private void CompleteAuthButton_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(VerifierTextBox.Text))
            {
                MessageBox.Show("You must paste the verifier code into the textbox above.");
                return;
            }

            Flickr f = FlickrManager.GetInstance();

            try
            {
                var accessToken = f.OAuthGetAccessToken(requestToken, VerifierTextBox.Text);
                FlickrManager.OAuthToken = accessToken;
                ResultLabel.Text         = "Successfully authenticated as " + accessToken.FullName;
            }
            catch (FlickrApiException ex)
            {
                MessageBox.Show("Failed to get access token. Error message: " + ex.Message);
            }
        }