public void LoadFromJson(string jsonString)
        {
            JObject jsonObject = JObject.Parse(jsonString);

            JArray jsonFilesArray = (JArray)jsonObject["files"];
            foreach (JObject jsonFile in jsonFilesArray)
            {
                GameFile gf = new GameFile();
                gf.Load(jsonFile);
                files.Add(gf);
            }
            sha = jsonObject["sha"].ToObject<string>();
            version = jsonObject["version"].ToObject<string>();       
        }
Example #2
0
        public void LoadFromJson(string jsonString)
        {
            var jsonObject = JObject.Parse(jsonString);

            var jsonFilesArray = (JArray)jsonObject["files"];

            foreach (JObject jsonFile in jsonFilesArray)
            {
                var gf = new GameFile();
                gf.Load(jsonFile);
                files.Add(gf);
            }
            sha     = jsonObject["sha"].ToObject <string>();
            version = jsonObject["version"].ToObject <string>();
        }
Example #3
0
        public void LoadFromJson(string jsonString)
        {
            JObject jObject = JObject.Parse(jsonString);

            using (IEnumerator <JToken> enumerator = ((JArray)jObject["files"]).GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    JObject  jsonObject = (JObject)enumerator.Current;
                    GameFile gameFile   = new GameFile();
                    gameFile.Load(jsonObject);
                    this.files.Add(gameFile);
                }
            }
            this.sha     = jObject["sha"].ToObject <string>();
            this.version = jObject["version"].ToObject <string>();
        }