Exemplo n.º 1
0
        public static PreferredColor DeserializeJSON(JToken token)
        {
            PreferredColor c = new PreferredColor()
            {
                PrimaryColor   = (string)token.SelectToken("primaryColor"),
                SecondaryColor = (string)token.SelectToken("secondaryColor"),
                TertiaryColor  = (string)token.SelectToken("tertiaryColor")
            };

            return(c);
        }
Exemplo n.º 2
0
        public XboxProfile(ProfileUser User)
        {
            ID     = Convert.ToInt64(User.id);
            HostID = Convert.ToInt64(User.hostId);
            //SponsoredUser = User.isSponsoredUser;
            foreach (Setting s in User.settings)
            {
                switch (s.id)
                {
                case "GameDisplayPicRaw":
                    GamerPic = new Uri(s.value);
                    break;

                case "Gamerscore":
                    Gamerscore = Convert.ToInt32(s.value);
                    break;

                case "Gamertag":
                    Gamertag = s.value;
                    break;

                case "AccountTier":
                    AccountTier = s.value;
                    break;

                case "XboxOneRep":
                    Reputation = s.value;
                    break;

                case "PreferredColor":
                    string ColorJSON = RestServices.GetResponse(new Uri(s.value));
                    PreferredColor = PreferredColor.DeserializeJSON(ColorJSON);
                    break;

                case "RealName":
                    RealName = s.value;
                    break;

                case "Bio":
                    Bio = s.value;
                    break;

                case "Location":
                    Location = s.value;
                    break;

                default:
                    break;
                }
            }
        }
Exemplo n.º 3
0
 public Friend(Person person)
 {
     xuid           = person.xuid;
     Favorite       = person.isFavorite;
     IsFriend       = person.isFollowedByCaller;
     IsFollower     = person.isFollowingCaller;
     SharedIdentity = person.isIdentityShared;
     DateAdded      = Convert.ToDateTime(person.addedDateTimeUtc);
     DisplayName    = person.displayName;
     RealName       = person.realName;
     ProfilePicture = new Uri(person.displayPicRaw);
     Gamertag       = person.gamertag;
     Gamerscore     = Convert.ToInt32(person.gamerScore);
     Reputation     = person.xboxOneRep;
     PresenceState  = person.presenceState;
     PresenceText   = person.presenceText;
     Summary        = person.multiplayerSummary;
     Color          = person.preferredColor;
 }
Exemplo n.º 4
0
 public static Person DeserializeJSON(JToken token)
 {
     Person p = new Person()
     {
         xuid = (string)token.SelectToken("xuid"),
         isFavorite = (bool)token.SelectToken("isFavorite"),
         isFollowingCaller = (bool)token.SelectToken("isFollowingCaller"),
         isFollowedByCaller = (bool)token.SelectToken("isFollowedByCaller"),
         isIdentityShared = (bool)token.SelectToken("isIdentityShared"),
         addedDateTimeUtc = (string)token.SelectToken("addedDateTimeUtc"),
         displayName = (string)token.SelectToken("displayName"),
         realName = (string)token.SelectToken("realName"),
         displayPicRaw = (string)token.SelectToken("displayPicRaw"),
         gamertag = (string)token.SelectToken("gamertag"),
         gamerScore = (string)token.SelectToken("gamerScore"),
         xboxOneRep = (string)token.SelectToken("xboxOneRep"),
         presenceState = (string)token.SelectToken("presenceState"),
         presenceText = (string)token.SelectToken("presenceText"),
         multiplayerSummary = MultiplayerSummary.DeserializeJSON(token.SelectToken("multiplayerSummary")),
         preferredColor = PreferredColor.DeserializeJSON(token.SelectToken("preferredColor"))
     };
     return p;
 }