private string GetPublicPhotoUrl(string photoId)
        {
            var f = FlickrManager.GetAuthInstance();

            PhotoInfo photoInfo = f.PhotosGetInfo(photoId);

            string farmId   = photoInfo.Farm;
            string serverId = photoInfo.Server;
            string secret   = photoInfo.Secret;

            return($"https://farm{farmId}.staticflickr.com/{serverId}/{photoId}_{secret}.jpg");
        }
        private void OnClickLinkAuthenticate(object sender, RoutedEventArgs e)
        {
            Flickr f = FlickrManager.GetInstance();

            //Obtain request token from Flickr OAuth server
            requestToken = f.OAuthGetRequestToken("oob");

            //Use request token to obtain a url to direct the user to where they can login securely
            string url = f.OAuthCalculateAuthorizationUrl(requestToken.Token, AuthLevel.Write);

            //launch url in browser
            System.Diagnostics.Process.Start(url);

            //Enable Step2
            step2Ctl.IsEnabled = true;
        }
        private async Task <string> UploadPhotoAsync(string photoPath)
        {
            var f = FlickrManager.GetAuthInstance();

            f.OnUploadProgress += new EventHandler <UploadProgressEventArgs>(FlickrOnUploadProgress);

            string fileName = photoPath;
            string title    = "Sample";
            string desc     = "";
            string tags     = null;
            bool   isPublic = true;
            bool   isFamily = false;
            bool   isFriend = false;

            string photoId = await Task <string> .Run(() => f.UploadPicture(fileName, title, desc, tags, isPublic, isFamily, isFriend));

            return(photoId);
        }
        private void OnClickLinkComplete(object sender, RoutedEventArgs e)
        {
            string verifierCode = verifierCodeCtl.Text;

            if (string.IsNullOrEmpty(verifierCode))
            {
                MessageBox.Show("Please paste the 'Verification Code' into the textbox above!");
                return;
            }

            Flickr f = FlickrManager.GetInstance();

            try
            {
                var accessToken = f.OAuthGetAccessToken(this.requestToken, verifierCode);
                FlickrManager.OAuthToken = accessToken;

                resultCtl.Text = $"Successfully authenticated as {accessToken.FullName.ToUpper()}!\nPlease close this dialog";
            }
            catch (FlickrApiException ex)
            {
                MessageBox.Show("Failed to get access token! Error Message: " + ex.Message);
            }
        }