public object Unpack(IDeserializer deserializer, IUnpacker unpacker)
 {
     CacheString cacheString = new CacheString()
                               {
                                   Id = deserializer.DeserializeVariantInt(),
                                   Value = deserializer.DeserializeString()
                               };
     this.RaiseEvent(CacheStringDeserializer, cacheString);
     return cacheString;
 }
示例#2
0
        public async Task <BookQuery> FindBooksAsync(string searchText)
        {
            if (string.IsNullOrWhiteSpace(searchText))
            {
                throw new ArgumentException();
            }

            string json = await downloader.DownloadStringAsync($"https://www.googleapis.com/books/v1/volumes?q={searchText}");

            return(deserializer.DeserializeString(json));
        }
        public void Deserialize(IDeserializer deserializer)
        {
            Name = deserializer.DeserializeString("Name");
            // Zombie
            var zombieDesers = deserializer.DeserializeAll("Zombie");
            foreach (var zombieDer in zombieDesers)
            {
                Zombies.Add(zombieDer.DeserializeString("Value"));
            }
            // Number
            var numberDer = deserializer.SubDeserializer("Number");
            NumberFrom = numberDer.DeserializeInteger("From");
            NumberTo = numberDer.DeserializeInteger("To");

            _timeNextWave = deserializer.DeserializeDouble("TimeNextWave");
            _timeBeginWave = deserializer.DeserializeDouble("TimeBeginWave");
            _timeNextZombieFrom = deserializer.DeserializeDouble("TimeNextZombieFrom");
            _timeNextZombieTo = deserializer.DeserializeDouble("TimeNextZombieTo");
        }
        public void Deserialize(IDeserializer deserializer)
        {
            Name = deserializer.DeserializeString("Name");

            var waveDers = deserializer.DeserializeAll("Wave");
            foreach (var item in waveDers)
            {
                Wave wave = new Wave();
                wave.Deserialize(item);
                Waves.Add(wave);
            }
        }