示例#1
0
        internal Gamer(IDictionary <string, object> dict)
        {
            foreach (string key in dict.Keys)
            {
                object value;
                dict.TryGetValue(key, out value);
                if (value == null)
                {
                    continue;
                }
                string valueString = value.ToString();

                switch (key)
                {
                case "gamer_id":
                    GamerId = valueString;
                    break;

                case "nickname":
                    Nickname = valueString;
                    break;

                case "name":
                    Name = valueString;
                    break;

                case "email":
                    Email = valueString;
                    break;

                case "timezone":
                    Timezone = valueString;
                    break;

                case "location":
                    Location = valueString;
                    break;

                case "locale":
                    Locale = valueString;
                    break;

                case "gender":
                    Gender = valueString;
                    break;

                case "created_at":
                    CreatedAt = (long)value;
                    break;

                case "updated_at":
                    UpdatedAt = (long)value;
                    break;

                case "profiles":
                    List <GamerProfile> pList        = new List <GamerProfile> ();
                    JsonArray           profileArray = (JsonArray)value;
                    foreach (object profileObject in profileArray)
                    {
                        GamerProfile profile = new GamerProfile((IDictionary <string, object>)profileObject);
                        pList.Add(profile);
                    }
                    Profiles = pList.ToArray();
                    break;
                }
            }
        }
示例#2
0
        internal Gamer(IDictionary<string, object> dict)
        {
            foreach (string key in dict.Keys) {
            object value;
            dict.TryGetValue (key, out value);
            if (value == null) {
              continue;
            }
            string valueString = value.ToString ();

            switch (key) {
            case "gamer_id":
              GamerId = valueString;
              break;
            case "nickname":
              Nickname = valueString;
              break;
            case "name":
              Name = valueString;
              break;
            case "email":
              Email = valueString;
              break;
            case "timezone":
              Timezone = valueString;
              break;
            case "location":
              Location = valueString;
              break;
            case "locale":
              Locale = valueString;
              break;
            case "gender":
              Gender = valueString;
              break;
            case "created_at":
              CreatedAt = (long)value;
              break;
            case "updated_at":
              UpdatedAt = (long)value;
              break;
            case "profiles":
              List<GamerProfile> pList = new List<GamerProfile> ();
              JsonArray profileArray = (JsonArray)value;
              foreach (object profileObject in profileArray) {
            GamerProfile profile = new GamerProfile ((IDictionary<string, object>)profileObject);
            pList.Add (profile);
              }
              Profiles = pList.ToArray ();
              break;
            }
              }
        }