Ejemplo n.º 1
0
        public IMUserInfo ParseFromJsonString(string jsonStr)
        {
            IMExtraUserInfoInternal jsonObj = JsonMapper.ToObject <IMExtraUserInfoInternal>(jsonStr);

            this.Extra      = jsonObj.extra;
            this.Level      = int.Parse(jsonObj.level);
            this.VipLevel   = int.Parse(jsonObj.vip_level);
            this.Location   = jsonObj.location;
            this.NickName   = jsonObj.nickname;
            this.ServerArea = jsonObj.server_area;
            return(this);
        }
Ejemplo n.º 2
0
        public string ToJsonString()
        {
            IMExtraUserInfoInternal jsonObj = new IMExtraUserInfoInternal();

            jsonObj.extra       = this.Extra;
            jsonObj.level       = this.Level.ToString();
            jsonObj.vip_level   = this.VipLevel.ToString();
            jsonObj.location    = this.Location;
            jsonObj.nickname    = this.NickName;
            jsonObj.server_area = this.ServerArea;
            return(JsonMapper.ToJson(jsonObj));
        }