internal static UploadOptions CreateFromXmlResponseMessage(XmlResponseMessage responseMessage) { UploadOptions userUploadOptions = new UploadOptions(); XmlNode uploadOptionsNode = responseMessage.ResponseXml.SelectSingleNode("descendant::content"); XmlNode defaultImageSizeNode = uploadOptionsNode.SelectSingleNode("descendant::defaultimagesize"); userUploadOptions.SetDefaultImageSize = PhotobucketImageSize.CreateFromString(defaultImageSizeNode.InnerText); XmlNode autoTaggingNode = uploadOptionsNode.SelectSingleNode("descendant::autotagging"); userUploadOptions._autoTagging = Boolean.Parse(autoTaggingNode.InnerText); return(userUploadOptions); }
public UploadOptions GetCurrentUsersUploadOptions() { string relativePath = GenerateRelativeUsersUploadOptionsUrl(); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); string getCurrentUsersUploadOptionsUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getUsersUploadOptionsMethod, Token, paramaters); XmlResponseMessage getCurrentUsersUploadOptionsResponseMessage = GetXmlResponseMessageFromUrl(getCurrentUsersUploadOptionsUrl, _getUsersUploadOptionsMethod); CurrentUser.SetUploadOptions = UploadOptions.CreateFromXmlResponseMessage(getCurrentUsersUploadOptionsResponseMessage); return(CurrentUser.UploadOptions); }
public UploadOptions UpdateCurrentUsersUploadOptions(ImageSize imageSize, bool autoTagging) { string relativePath = GenerateRelativeUsersUploadOptionsUrl(); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); paramaters.Add(new QueryParameter(_defaultimagesize, Convert.ToString(imageSize))); paramaters.Add(new QueryParameter(_autotagging, autoTagging ? "1" : "0")); string updateCurrentUsersUploadOptionsUrl = OAuth.GenerateURL(ApiUrl, relativePath, _updateUsersUploadOptionsMethod, Token, paramaters); XmlResponseMessage updateCurrentUsersUploadOptionsResponseMessage = GetXmlResponseMessageFromUrl(updateCurrentUsersUploadOptionsUrl, _updateUsersUploadOptionsMethod); UploadOptions userUploadOptions = new UploadOptions(); userUploadOptions.SetDefaultImageSize = imageSize; userUploadOptions.SetAutoTagging = autoTagging; CurrentUser.SetUploadOptions = userUploadOptions; return(_currentUser.UploadOptions); }
internal static UploadOptions CreateFromXmlResponseMessage(XmlResponseMessage responseMessage) { UploadOptions userUploadOptions = new UploadOptions(); XmlNode uploadOptionsNode = responseMessage.ResponseXml.SelectSingleNode("descendant::content"); XmlNode defaultImageSizeNode = uploadOptionsNode.SelectSingleNode("descendant::defaultimagesize"); userUploadOptions.SetDefaultImageSize = PhotobucketImageSize.CreateFromString(defaultImageSizeNode.InnerText); XmlNode autoTaggingNode = uploadOptionsNode.SelectSingleNode("descendant::autotagging"); userUploadOptions._autoTagging = Boolean.Parse(autoTaggingNode.InnerText); return userUploadOptions; }
public UploadOptions UpdateCurrentUsersUploadOptions(ImageSize imageSize, bool autoTagging) { string relativePath = GenerateRelativeUsersUploadOptionsUrl(); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); paramaters.Add(new QueryParameter(_defaultimagesize, Convert.ToString(imageSize))); paramaters.Add(new QueryParameter(_autotagging, autoTagging ? "1" : "0" )); string updateCurrentUsersUploadOptionsUrl = OAuth.GenerateURL(ApiUrl, relativePath, _updateUsersUploadOptionsMethod, Token, paramaters); XmlResponseMessage updateCurrentUsersUploadOptionsResponseMessage = GetXmlResponseMessageFromUrl(updateCurrentUsersUploadOptionsUrl, _updateUsersUploadOptionsMethod); UploadOptions userUploadOptions = new UploadOptions(); userUploadOptions.SetDefaultImageSize = imageSize; userUploadOptions.SetAutoTagging = autoTagging; CurrentUser.SetUploadOptions = userUploadOptions; return _currentUser.UploadOptions; }