示例#1
0
 public void Load()
 {
     try
     {
         if (File.Exists(this.StoreFile))
         {
             this.Store = JsonFactory.FromFile <Dictionary <string, object> >(this.StoreFile);
         }
     }
     catch (Exception e)
     {
         Log.Error(e);
     }
 }
示例#2
0
        public void Load()
        {
            try
            {
                this.Cache = new Dictionary <string, CacheEntry>();

                if (File.Exists(this.StoreFile))
                {
                    var data = JsonFactory.FromFile <Dictionary <string, ObjectValue> >(this.StoreFile);

                    foreach (var entry in data)
                    {
                        this.Cache[entry.Key] = new CacheEntry(this, entry.Key, Convert.ChangeType(entry.Value.Value, entry.Value.Type));
                    }
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }