Example #1
0
 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);
 }
Example #2
0
        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);
            }
        }
Example #3
0
 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);
     }
 }