Пример #1
0
        public static T Load(string key)
        {
            T local = SerializeUtils.Deserialize <T>(key);

            if (local == null)
            {
                local      = new T();
                local.sKey = key;
                local.OnInit(false);
            }
            else
            {
                local.sKey = key;
                local.OnInit(true);
            }

            return(local);
        }
Пример #2
0
 public virtual bool Save(string key = null)
 {
     return(string.IsNullOrEmpty(key) ?
            SerializeUtils.Serialize(this, sKey) :
            SerializeUtils.Serialize(this, key));
 }