public override bool Load(string versionReuired) { try { string str; TrainsCacheStorage storage = new TrainsCacheStorage(); if (storage.Load(out str, out this.LastError)) { TrainsCache cache = DCSerializer.DeserializeWithDCS(typeof(TrainsCache), str) as TrainsCache; base.CacheTime = cache.CacheTime; this.Trains = cache.Trains; base.Version = cache.Version; if (!cache.IsValid(versionReuired, out this.LastError)) { return(false); } return(true); } } catch (Exception exception) { base.LastError = exception.Message; } return(false); }
private void TrainsStateLoadFromCache(string version) { TrainsCache cache = new TrainsCache(); if (cache.Load(version)) { this.DrawTrains(cache.Trains, new List <TrainWebData>(), new List <TrainWebData>()); } else { this.AddLog("TrainsCache was not loaded: " + cache.LastError); } }
private void TrainsStateLoadFromCache(string version) { TrainsCache cache = new TrainsCache(); if (cache.Load(version)) { this.DrawTrains(cache.Trains, new List<TrainWebData>(), new List<TrainWebData>()); } else { this.AddLog("TrainsCache was not loaded: " + cache.LastError); } }