예제 #1
0
        /// <summary>
        /// Modifies the user's profile.
        /// </summary>
        /// <param name="profile">The profile object to apply. Any properties that are null or empty will not be applied.</param>
        /// <param name="callback">The callback delegate to invoke on the server response.</param>
        public void ModifyProfile(Profile profile, Action<JObject> callback)
        {
            JObject json = JObject.FromObject(profile);

            if (!string.IsNullOrEmpty(profile.About))
            {
                json.Add(new JProperty("about", profile.About));
            }

            if (!string.IsNullOrEmpty(profile.About))
            {
                json.Add(new JProperty("facebook", profile.Facebook));
            }

            if (!string.IsNullOrEmpty(profile.About))
            {
                json.Add(new JProperty("hangout", profile.Hangout));
            }

            if (!string.IsNullOrEmpty(profile.About))
            {
                json.Add(new JProperty("name", profile.Name));
            }

            if (!string.IsNullOrEmpty(profile.About))
            {
                json.Add(new JProperty("topartists", profile.TopArtists));
            }

            if (!string.IsNullOrEmpty(profile.About))
            {
                json.Add(new JProperty("twitter", profile.Twitter));
            }

            if (!string.IsNullOrEmpty(profile.About))
            {
                json.Add(new JProperty("website", profile.Website));
            }

            json.Add(new JProperty("api", "user.modify_profile"));

            this.Send(json, callback);
        }
예제 #2
0
 /// <summary>
 /// Modifies the user's profile.
 /// </summary>
 /// <param name="profile">The profile object to apply. Any properties that are null or empty will not be applied.</param>
 public void ModifyProfile(Profile profile)
 {
     this.ModifyProfile(profile);
 }