public void AddMediaTag(MediaItem mediaItem, MediaTag tag) { string relativePath = GenerateRelativeMediaTagUrl(mediaItem.Url); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); paramaters.Add(new QueryParameter("topleftx", tag.TopLeftX.ToString())); paramaters.Add(new QueryParameter("toplefty", tag.TopLeftY.ToString())); paramaters.Add(new QueryParameter("bottomrightx", tag.BottomRightX.ToString())); paramaters.Add(new QueryParameter("bottomrighty", tag.BottomRightY.ToString())); paramaters.Add(new QueryParameter("tag", tag.Name)); if (string.IsNullOrEmpty(tag.Contact) == false) { paramaters.Add(new QueryParameter("contact", tag.Contact)); } if (string.IsNullOrEmpty(tag.Url) == false) { paramaters.Add(new QueryParameter("tagurl", tag.Url)); } string addMediaTagUrl = OAuth.GenerateURL(ApiUrl, relativePath, _addMediaTagMethod, Token, paramaters); XmlResponseMessage addMediaTagResponseMessage = GetXmlResponseMessageFromUrl(addMediaTagUrl, _addMediaTagMethod); }
private MediaItem UploadMediaItemToAlbum(MediaItem mediaItem, string albumPath) { string relativeUploadUrl = GenerateRelativeUploadUrl(albumPath); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); paramaters.Add(new QueryParameter(_type, mediaItem.Type)); if (string.IsNullOrEmpty(mediaItem.Description) == false) { paramaters.Add(new QueryParameter(_description, OAuth.UrlEncode(mediaItem.Description))); } if (string.IsNullOrEmpty(mediaItem.Title) == false) { paramaters.Add(new QueryParameter(_title, OAuth.UrlEncode(mediaItem.Title))); } QueryParameterList mediaParamaters = OAuth.GenerateOAuthParamaters(relativeUploadUrl, _uploadMediaMethod, Token, paramaters); string uploadMediaItemUrl = ApiUrl + relativeUploadUrl + "?format=xml"; XmlResponseMessage uploadMediaItemResponse = GetResponseForUploadMediaItem(uploadMediaItemUrl, mediaItem, mediaParamaters); MediaItem newMediaItem = new MediaItem(uploadMediaItemResponse.ResponseXml); _currentUser.MediaList.Add(newMediaItem); return(newMediaItem); }
public void RotateImage(MediaItem mediaItem, int degrees) { string relativePath = GenerateRelativeRotateImageUrl(mediaItem.Url); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); string rotateImageUrl = OAuth.GenerateURL(ApiUrl, relativePath, _rotateImageMethod, Token, paramaters); XmlResponseMessage rotateImageResponseMessage = GetXmlResponseMessageFromUrl(rotateImageUrl, _rotateImageMethod); }
private void DeleteAlbum(string albumPath) { string relativePath = GenerateRelativeAlbumUrl(albumPath); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); string deleteAlbumUrl = OAuth.GenerateURL(ApiUrl, relativePath, _deleteAlbumMethod, Token, paramaters); XmlResponseMessage deleteAlbumResponseMessage = GetXmlResponseMessageFromUrl(deleteAlbumUrl, _deleteAlbumMethod); }
private void RenameAlbum(string origAlbumPath, string newAlbumName) { string relativePath = GenerateRelativeAlbumUrl(origAlbumPath); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_name, newAlbumName)); paramaters.Add(new QueryParameter(_format, "xml")); string renameAlbumUrl = OAuth.GenerateURL(ApiUrl, relativePath, _renameAlbumMethod, Token, paramaters); XmlResponseMessage renameAlbumResponseMessage = GetXmlResponseMessageFromUrl(renameAlbumUrl, _renameAlbumMethod); }
/// <summary> /// Get the User object that represents the user currently logged on /// </summary> /// <returns></returns> private User GetUser(string username) { string relativePath = GenerateRelativeUserUrl(username); QueryParameterList paramaters = new QueryParameterList( ); paramaters.Add(new QueryParameter(_format, "xml")); string getUserUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getUserMethod, Token, paramaters); XmlResponseMessage getUserResponseMessage = GetXmlResponseMessageFromUrl(getUserUrl, _getUserMethod); return(new User(getUserResponseMessage.ResponseXml)); }
public void ShareMediaViaEmail(MediaItem mediaItem, string email, string body) { string relativePath = GenerateRelativeShareUrl(mediaItem.Url); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); paramaters.Add(new QueryParameter("body", body)); paramaters.Add(new QueryParameter("email", email)); string shareMediaViaEmailUrl = OAuth.GenerateURL(ApiUrl, relativePath, _shareMediaViaEmailMethod, Token, paramaters); XmlResponseMessage shareMediaViaEmailResponseMessage = GetXmlResponseMessageFromUrl(shareMediaViaEmailUrl, _shareMediaViaEmailMethod); }
public void DeleteMediaDescription(ref MediaItem mediaItem) { string relativePath = GenerateRelativeMediaDescriptionUrl(mediaItem.Url); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); string deleteMediaDescriptionUrl = OAuth.GenerateURL(ApiUrl, relativePath, _deleteMediaDescriptionMethod, Token, paramaters); XmlResponseMessage deleteMediaDescriptionResponseMessage = GetXmlResponseMessageFromUrl(deleteMediaDescriptionUrl, _deleteMediaDescriptionMethod); mediaItem.Description = String.Empty; }
public void DeleteMediaTag(MediaItem mediaItem, MediaTag tag) { string relativePath = GenerateRelativeMediaTagUrl(mediaItem.Url); relativePath = relativePath + "/" + tag.TagId.ToString(); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); string deleteMediaTagUrl = OAuth.GenerateURL(ApiUrl, relativePath, _deleteMediaTagMethod, Token, paramaters); XmlResponseMessage deleteMediaTagResponseMessage = GetXmlResponseMessageFromUrl(deleteMediaTagUrl, _deleteMediaTagMethod); }
private XmlDocument GetMediaLinks(MediaItem mediaItem) { string relativePath = GenerateRelativeMediaLinksUrl(mediaItem.Url); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); string getMediaLinksUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getMediaLinksMethod, Token, paramaters); XmlResponseMessage getMediaLinksResponseMessage = GetXmlResponseMessageFromUrl(getMediaLinksUrl, _getMediaLinksMethod); return(getMediaLinksResponseMessage.ResponseXml); }
private Privacy GetAlbumsPrivacySettings(string albumPath) { string relativePath = GenerateRelativeAlbumPrivacyUrl(albumPath); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); string getAlbumPrivacySettingsUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getAlbumPrivacyMethod, Token, paramaters); XmlResponseMessage getAlbumPrivacySettingsResponseMessage = GetXmlResponseMessageFromUrl(getAlbumPrivacySettingsUrl, _getAlbumPrivacyMethod); return(GetPrivacyFromResponseMessage(getAlbumPrivacySettingsResponseMessage)); }
public UserUrls GetUsersUrls(string username) { string relativePath = GenerateRelativeUserUrl(username); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); string getUsersUrlsUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getUsersUrlMethod, Token, paramaters); XmlResponseMessage getUsersUrlsResponseMessage = GetXmlResponseMessageFromUrl(getUsersUrlsUrl, _getUsersUrlMethod); return(UserUrls.CreateFromXmlResponseMessage(getUsersUrlsResponseMessage)); }
public MediaItemList GetFeaturedMedia() { string relativePath = GenerateRelativeFeaturedUrl(); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); string getFeaturedMediaUrl = OAuth.GenerateURL(_apiUrl, relativePath, _featuredMediaMethod, Token, paramaters); XmlResponseMessage getFeaturedMediaResponseMessage = GetXmlResponseMessageFromUrl(getFeaturedMediaUrl, _featuredMediaMethod); return(MediaItemList.CreateFromXmlResponseMessage(getFeaturedMediaResponseMessage)); }
private Album CreateNewAlbum(string albumName, string albumPath) { string relativePath = GenerateRelativeAlbumUrl(albumPath); QueryParameterList paramaters = new QueryParameterList( ); paramaters.Add(new QueryParameter(_name, albumName)); paramaters.Add(new QueryParameter(_format, "xml")); string createNewAlbumUrl = OAuth.GenerateURL(ApiUrl, relativePath, _createAlbumMethod, Token, paramaters); XmlResponseMessage createNewAlbumResponseMessage = GetXmlResponseMessageFromUrl(createNewAlbumUrl, _createAlbumMethod); return(new Album(albumName, albumPath)); }
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 MediaItem GetMediaInformation(ref MediaItem mediaItem) { string relativePath = GenerateRelativeMediaInformationUrl(mediaItem.Url); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); string getMediaInformationUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getMediaInformationMethod, Token, paramaters); XmlResponseMessage getMediaInformationResponseMessage = GetXmlResponseMessageFromUrl(getMediaInformationUrl, _getMediaInformationMethod); mediaItem = MediaItem.CreateFromXmlNode(mediaItem.MediaType, getMediaInformationResponseMessage.ResponseXml.SelectSingleNode("descendant::media")); return(mediaItem); }
public void SetMediaTitle(ref MediaItem mediaItem, string title) { string relativePath = GenerateRelativeMediaTitleUrl(mediaItem.Url); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); paramaters.Add(new QueryParameter(_title, title)); string setMediaTitleUrl = OAuth.GenerateURL(ApiUrl, relativePath, _setMediaTitleMethod, Token, paramaters); XmlResponseMessage setMediaTitleResponseMessage = GetXmlResponseMessageFromUrl(setMediaTitleUrl, _setMediaTitleMethod); mediaItem.Title = title; }
public MetaData GetMediaMetaData(ref MediaItem mediaItem) { string relativePath = GenerateRelativeMediaMetaDataUrl(mediaItem.Url); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); string getMediaMetaDataUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getMediaMetaDataMethod, Token, paramaters); XmlResponseMessage getMediaMetaDataResponseMessage = GetXmlResponseMessageFromUrl(getMediaMetaDataUrl, _getMediaMetaDataMethod); mediaItem.SetMetaData = MetaData.CreateFromXmlResponseMessage(getMediaMetaDataResponseMessage); return(mediaItem.MetaData); }
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 UserContactList GetCurrentUsersContacts() { string relativePath = GenerateRelativeUsersContactsUrl(_currentUser.Username); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); string getUsersContactsUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getUserContactsMethod, Token, paramaters); XmlResponseMessage getUsersContactsResponseMessage = GetXmlResponseMessageFromUrl(getUsersContactsUrl, _getUserContactsMethod); _currentUser.SetContact = UserContactList.CreateFromXmlResponseMessage(getUsersContactsResponseMessage); return(_currentUser.Contacts); }
public MediaTag GetMediaTag(MediaItem mediaItem, int tagId) { string relativePath = GenerateRelativeMediaTagUrl(mediaItem.Url); relativePath = relativePath + "/" + tagId.ToString(); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); string getMediaTagUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getMediaTagMethod, Token, paramaters); XmlResponseMessage getMediaTagResponseMessage = GetXmlResponseMessageFromUrl(getMediaTagUrl, _getMediaTagMethod); return(MediaTag.CreateFromXmlNode(getMediaTagResponseMessage.ResponseXml.SelectSingleNode("descendant::content"))); }
public MediaItemList GetUsersRecentMedia(string username, MediaType type, int page, int perPage) { string relativePath = GenerateRelativeUserSearchUrl(username); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); paramaters.Add(new QueryParameter(_type, type.ToString().ToLower())); paramaters.Add(new QueryParameter(_page, page.ToString())); paramaters.Add(new QueryParameter(_perpage, perPage.ToString())); string getUsersRecentMediaUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getUserMediaMethod, Token, paramaters); XmlResponseMessage getUsersRecentMediaResponseMessage = GetXmlResponseMessageFromUrl(getUsersRecentMediaUrl, _getUserMediaMethod); return(MediaItemList.CreateFromXmlResponseMessage(getUsersRecentMediaResponseMessage)); }
public AlbumList GetAllUsersAlbums(string username) { string relativePath = GenerateRelativeAlbumUrl(username); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); paramaters.Add(new QueryParameter(_recurse, "1")); paramaters.Add(new QueryParameter(_view, "flat")); paramaters.Add(new QueryParameter(_media, "none")); string getAllUsersAlbumsUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getAlbumMethod, Token, paramaters); XmlResponseMessage getAllUsersAlbumsResponseMessage = GetXmlResponseMessageFromUrl(getAllUsersAlbumsUrl, _getAlbumMethod); return(AlbumList.CreateFromXmlResponseMessage(getAllUsersAlbumsResponseMessage)); }
public string GetMediaDescription(ref MediaItem mediaItem) { string relativePath = GenerateRelativeMediaDescriptionUrl(mediaItem.Url); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); string getMediaDescriptionUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getMediaDescriptionMethod, Token, paramaters); XmlResponseMessage getMediaDescriptionResponseMessage = GetXmlResponseMessageFromUrl(getMediaDescriptionUrl, _getMediaDescriptionMethod); XmlNode descriptionNode = getMediaDescriptionResponseMessage.ResponseXml.SelectSingleNode("descendant::description"); mediaItem.Description = descriptionNode.InnerText; return(mediaItem.Description); }
public MediaItemList GetRelatedMedia(MediaItem mediaItem, int num, MediaType mediaType) { string relativePath = GenerateRelativeRelatedMediaUrl(mediaItem.Url); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); paramaters.Add(new QueryParameter(_num, num.ToString())); string type = mediaType == MediaType.Image ? "images" : "videos"; paramaters.Add(new QueryParameter(_type, type)); string getRelatedMediaUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getRelatedMediaMethod, Token, paramaters); XmlResponseMessage getRelatedMediaResponseMessage = GetXmlResponseMessageFromUrl(getRelatedMediaUrl, _getRelatedMediaMethod); return(MediaItemList.CreateFromXmlNodeList(getRelatedMediaResponseMessage.ResponseXml.SelectNodes("descendant::media"))); }
private Album GetAlbum(string albumPath, bool recurse, string view, string media, bool paginated, int page, int perpage) { string relativePath = GenerateRelativeAlbumUrl(albumPath); QueryParameterList paramaters = new QueryParameterList( ); paramaters.Add(new QueryParameter(_format, "xml")); paramaters.Add(new QueryParameter(_recurse, recurse ? "1" : "0")); paramaters.Add(new QueryParameter(_view, view)); paramaters.Add(new QueryParameter(_media, media)); paramaters.Add(new QueryParameter(_paginated, paginated ? "1" : "0")); paramaters.Add(new QueryParameter(_page, page.ToString())); paramaters.Add(new QueryParameter(_perpage, perpage.ToString())); string getUsersAlbumUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getAlbumMethod, Token, paramaters); XmlResponseMessage getUsersAlbumResponseMessage = GetXmlResponseMessageFromUrl(getUsersAlbumUrl, _getAlbumMethod); return(new Album(getUsersAlbumResponseMessage.ResponseXml.SelectSingleNode("descendant::album"))); }
internal static MetaData CreateFromXmlResponseMessage(XmlResponseMessage responseMessage) { MetaData metaData = new MetaData(); XmlNode exifNode = responseMessage.ResponseXml.SelectSingleNode("descendant::exif"); XmlNode resolutionNode = exifNode.SelectSingleNode("descendant::Resolution"); metaData._resolution = resolutionNode.InnerText; XmlNode commentNode = exifNode.SelectSingleNode("descendant::Comment"); metaData._comment = commentNode.InnerText; XmlNode widthNode = responseMessage.ResponseXml.SelectSingleNode("descendant::width"); metaData._width = Convert.ToInt32(widthNode.InnerText); XmlNode heightNode = responseMessage.ResponseXml.SelectSingleNode("descendant::height"); metaData._height = Convert.ToInt32(heightNode.InnerText); return metaData; }
public MediaItemList GetUsersMediaWithTag(string username, string tagname, int page, int perPage) { if (string.IsNullOrEmpty(tagname)) { throw new PhotobucketApiException("tagname is null"); } string relativePath = GenerateRelativeUsersMediaWithTagUrl(username, tagname); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); paramaters.Add(new QueryParameter(_page, page.ToString())); paramaters.Add(new QueryParameter(_perpage, perPage.ToString())); string getUsersMediaWithTagTagsUrl = OAuth.GenerateURL(ApiUrl, relativePath, _getUsersMediaTagsMethod, Token, paramaters); XmlResponseMessage getUsersMediaWithTagResponseMessage = GetXmlResponseMessageFromUrl(getUsersMediaWithTagTagsUrl, _getUsersMediaTagsMethod); return(MediaItemList.CreateFromXmlResponseMessage(getUsersMediaWithTagResponseMessage)); }
public MediaItemList SearchMedia(string query, int num, int perpage, int page, int offset, int secondaryperpage, string type, bool recentFirst) { string relativePath = GenerateRelativeSearchUrl(query); QueryParameterList paramaters = new QueryParameterList(); paramaters.Add(new QueryParameter(_format, "xml")); paramaters.Add(new QueryParameter(_num, num.ToString())); paramaters.Add(new QueryParameter(_perpage, perpage.ToString())); paramaters.Add(new QueryParameter(_page, page.ToString())); paramaters.Add(new QueryParameter(_offset, offset.ToString())); paramaters.Add(new QueryParameter(_secondaryperpage, secondaryperpage.ToString())); paramaters.Add(new QueryParameter(_type, type)); paramaters.Add(new QueryParameter(_recentfirst, recentFirst ? "1" : "0")); string searchMediaUrl = OAuth.GenerateURL(_apiUrl, relativePath, _searchMediaMethod, Token, paramaters); XmlResponseMessage searchMediaResponseMessage = GetXmlResponseMessageFromUrl(searchMediaUrl, _searchMediaMethod); return(MediaItemList.CreateFromXmlResponseMessage(searchMediaResponseMessage)); }
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); }
private Privacy GetPrivacyFromResponseMessage(XmlResponseMessage responseMessage) { XmlNode privacyNode = responseMessage.ResponseXml.SelectSingleNode("descendant::content"); if (privacyNode == null) { throw new PhotobucketApiException("Did not find content in xml response from GetAlbumPrivacySettigns"); } if (privacyNode.InnerText == "public") { return(Privacy.PUBLIC); } else if (privacyNode.InnerText == "private") { return(Privacy.PRIVATE); } else { throw new PhotobucketApiException("Did not see public or private for privacy settings"); } }
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; }
internal static UserUrls CreateFromXmlResponseMessage(XmlResponseMessage responseMessage) { UserUrls userUrl = new UserUrls(); XmlNode subdomainNode = responseMessage.ResponseXml.SelectSingleNode("descendant::subdomain"); XmlNode albumNode = subdomainNode.SelectSingleNode("descendant::album"); userUrl._album = albumNode.InnerText; XmlNode imageNode = subdomainNode.SelectSingleNode("descendant::image"); userUrl._image = imageNode.InnerText; XmlNode apiNode = subdomainNode.SelectSingleNode("descendant::api"); userUrl._api = apiNode.InnerText; XmlNode feedNode = subdomainNode.SelectSingleNode("descendant::feed"); userUrl._feed = feedNode.InnerText; XmlNode pathNode = responseMessage.ResponseXml.SelectSingleNode("descendant::path"); userUrl._path = pathNode.InnerText; return userUrl; }
private Privacy GetPrivacyFromResponseMessage(XmlResponseMessage responseMessage) { XmlNode privacyNode = responseMessage.ResponseXml.SelectSingleNode("descendant::content"); if (privacyNode == null) { throw new PhotobucketApiException("Did not find content in xml response from GetAlbumPrivacySettigns"); } if (privacyNode.InnerText == "public") { return Privacy.PUBLIC; } else if (privacyNode.InnerText == "private") { return Privacy.PRIVATE; } else { throw new PhotobucketApiException("Did not see public or private for privacy settings"); } }