private void parseUser(JSONResponse jresponse, ref RUserDetails userDetails) { RUserLimitDetails limitDetails = null; if (!(jresponse.JSONMarkup["user"] == null)) { JObject juser = jresponse.JSONMarkup["user"].Value <JObject>(); String username = JSONUtilities.trimXtraQuotes(juser["username"].Value <String>()); String displayname = JSONUtilities.trimXtraQuotes(juser["displayname"].Value <String>()); String cookie = JSONUtilities.trimXtraQuotes(juser["cookie"].Value <String>()); JObject jlimits = jresponse.JSONMarkup["limits"].Value <JObject>(); parseLimits(jlimits, ref limitDetails); userDetails = new RUserDetails(username, displayname, cookie, limitDetails); } }
/// <summary> /// Gets the details associated with this user /// </summary> /// <returns>RUserDetails object</returns> /// <remarks></remarks> public RUserDetails about() { StringBuilder data = new StringBuilder(); RUserDetails userDetails = null; //set the url String uri = Constants.RUSERABOUT; //create the input String data.Append(Constants.FORMAT_JSON); //call the server JSONResponse jresponse = HTTPUtilities.callRESTGet(uri, data.ToString(), ref m_client); parseUser(jresponse, ref userDetails); return(userDetails); }