Beispiel #1
0
        private void ParseXMLDocument()
        {
            var trophyConfig = document["trophyconf"];

            NPCommID         = trophyConfig.ChildNodes[0].InnerText;
            TrophySetVersion = trophyConfig.ChildNodes[1].InnerText;
            ParentalLevel    = trophyConfig.ChildNodes[2].InnerText;
            TitleName        = trophyConfig.ChildNodes[3].InnerText;
            TitleDetail      = trophyConfig.ChildNodes[4].InnerText;

            // Iterate through all of our trophies as stored in the file.
            for (int i = 5; i < trophyConfig.ChildNodes.Count; i++)
            {
                var trophyNode = trophyConfig.ChildNodes[i];
                Trophies.Add(new Trophy
                {
                    ID       = int.Parse(trophyNode.Attributes["id"].Value),
                    Hidden   = trophyNode.Attributes["hidden"].Value.Equals("yes") ? true : false,
                    Type     = (Trophy.TrophyType)(Encoding.UTF8.GetBytes(trophyNode.Attributes["ttype"].Value)[0]),
                    PID      = int.Parse(trophyNode.Attributes["pid"].Value),
                    Name     = (trophyNode.ChildNodes[0]).InnerText,
                    Detail   = (trophyNode.ChildNodes[1]).InnerText,
                    PNGFiles = PNGFiles
                });
            }
        }
Beispiel #2
0
        public async void SetTrophyList(string userName, string npCommunicationId)
        {
            IsLoading = true;
            TrophyDetailEntity trophys =
                await
                _trophyDetailManager.GetTrophyDetailList(npCommunicationId,
                                                         userName, true,
                                                         App.UserAccountEntity);

            if (trophys == null)
            {
                IsLoading = false;
                return;
            }
            if (trophys.Trophies == null)
            {
                IsLoading = false;
                return;
            }
            foreach (TrophyDetailEntity.Trophy trophy in trophys.Trophies)
            {
                Trophies.Add(trophy);
            }
            if (!trophys.Trophies.Any())
            {
                IsEmpty = true;
            }
            IsLoading = false;
        }