/// <summary> /// Updates user preferences information properties /// </summary> public async Task RequestPreferencesAsync() { var result = await PostRequestAsync(URL_API, "api_dev_key=" + Pastebin.DevKey, "api_user_key=" + userKey, "api_option=" + "userdetails"); if (result.Contains(ERROR)) { throw new PastebinException(result); } /* Example user xml * <user> * <user_name>wiz_kitty</user_name> * <user_format_short>text</user_format_short> * <user_expiration>N</user_expiration> * <user_avatar_url>https://pastebin.com/cache/a/1.jpg</user_avatar_url> * <user_private>1</user_private> (0 Public, 1 Unlisted, 2 Private) * <user_website>http://myawesomesite.com</user_website> * <user_email>[email protected]</user_email> * <user_location>New York</user_location> * <user_account_type>1</user_account_type> (0 normal, 1 PRO) * </user>*/ XElement xuser = XElement.Parse(result); Name = xuser.Element("user_name").Value; PreferedLanguage = Language.Parse(xuser.Element("user_format_short").Value); PreferedExpiration = Expiration.Parse(xuser.Element("user_expiration").Value); PreferedVisibility = (Visibility)(int)xuser.Element("user_private"); AvatarURL = xuser.Element("user_avatar_url").Value; Website = xuser.Element("user_website").Value; Email = xuser.Element("user_email").Value; Location = xuser.Element("user_location").Value; IsPro = xuser.Element("user_account_type").Value == "1"; }