Exemplo n.º 1
0
      internal static User CreateFromXmlDocument(XmlNode userNode)
      {
         User user = new User("username");

         user.ParseFromXmlNode(userNode);

         return user;
      }
 public MediaItemList GetAllUsersImageMedia(ref User user)
 {
    user.SetImageMediaList = GetAllUsersImageMedia(user.Username);
    return user.ImageMediaList;
 }
 public MediaItemList GetAllUsersVideoMedia(ref User user)
 {
    user.SetVideoMediaList = GetAllUsersVideoMedia(user.Username);
    return user.VideoMediaList;
 }
      /// <summary>
      /// Requests the token and secret for the user that logged in
      /// </summary>
      public UserToken RequestUserToken()
      {
         if (!AppAuthorized)
         {
            throw ( new PhotobucketApiException( "App Not Authorized" ) );
         }

         string userTokenUrl = OAuth.GenerateURL( _apiUrl, _userTokenUrl, _userTokenMethod, _consumerToken );

         ResponseMessage userTokenResponseMessage = GetResponseMessageFromUrl( userTokenUrl, _userTokenMethod );

         _userToken = OAuth.GetUserTokenFromResponse( userTokenResponseMessage.ResponseString );
         _userLoggedOn = true;
         _appAuthorized = false;
         _consumerToken = null;
         _currentUser = new User(_userToken.Username);
         
         return _userToken;
      }