Exemplo n.º 1
0
        private void ParseFromXmlNode(XmlNode userNode)
        {
            XmlNode usernameNode = userNode.SelectSingleNode(_usernameXml);

            _username = usernameNode.InnerText;

            XmlNode albumUrlNode = userNode.SelectSingleNode(_albumUrlXml);

            _albumUrl = albumUrlNode.InnerText;

            XmlNode megabytesUsedNode = userNode.SelectSingleNode(_megabytesUsedXml);

            _megabytesUsed = Convert.ToInt32(megabytesUsedNode.InnerText);

            XmlNode megabytesAllowedNode = userNode.SelectSingleNode(_megabytesAllowedXml);

            _megabytesAllowed = Convert.ToInt32(megabytesAllowedNode.InnerText);

            XmlNode premiumNode = userNode.SelectSingleNode(_premiumXml);

            _premium = Convert.ToBoolean(Convert.ToInt32(premiumNode.InnerText));

            XmlNode publicAccessNode = userNode.SelectSingleNode(_publicAccessXml);

            _publicAccess = Convert.ToBoolean(Convert.ToInt32(publicAccessNode.InnerText));

            XmlNode mediaCountNode = userNode.SelectSingleNode(_mediaCountXml);

            _mediaCount = Convert.ToInt32(mediaCountNode.InnerText);

            XmlNode preferredPictureSizeNode = userNode.SelectSingleNode(_preferredPictureSizeXml);

            _preferredPictureSize = PhotobucketImageSize.CreateFromString(preferredPictureSizeNode.InnerText);
        }
Exemplo n.º 2
0
        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);
        }