FlickrNet.Flickr.TestLogin C# (CSharp) Method

TestLogin() public method

Test the logged in state of the current Filckr object.
public TestLogin ( ) : FoundUser
return FoundUser
        public FoundUser TestLogin()
        {
            Hashtable parameters = new Hashtable();
            parameters.Add("method", "flickr.test.login");

            FlickrNet.Response response = GetResponseCache(parameters);

            if( response.Status == ResponseStatus.OK )
            {
                return new FoundUser(response.AllElements[0]);
            }
            else
            {
                throw new FlickrException(response.Error);
            }
        }

Usage Example

Exemplo n.º 1
0
    public void AttemptConnection()
    {
        string token = PersistentInformation.GetInstance().Token;
          try {
            flickrObj = new Flickr(_apikey, _secret, token);
            flickrObj.TestLogin();
        _isConnected = true;
          } catch (FlickrNet.FlickrApiException e) {
            PrintException(e);
            _isConnected = false;
            return;
          }

          Gtk.Application.Invoke (delegate {
        if (_isConnected) {
          DeskFlickrUI.GetInstance().SetStatusLabel("Login Successful.");
        } else {
          DeskFlickrUI.GetInstance().SetStatusLabel("Unable to connect.");
        }
          });
          UpdateUIAboutConnection();
    }
Flickr