Exemple #1
0
        public string CacheTo <T>(T instance, WinterWrapUp cw) where T : ICachable
        {
            JObject final = new JObject();

            final["name"]  = cw.markName;
            final["date"]  = cw.createDate;
            final["clean"] = cw.deletable;
            final["ctx"]   = WriteNested(instance);
            return(final.ToString());
        }
        public void CacheMusicCatalogue(Catalogue cata)
        {
            WinterWrapUp cw = new WinterWrapUp()
            {
                createDate = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"),
                deletable  = false,
                markName   = CacheUtils.GenerateMarkName("CATALOGUE"),
                uid        = Guid.NewGuid().ToString()
            };

            byte[] cstring = Encoding.UTF8.GetBytes(caches.CacheTo(cata, cw));
            Compressed.writeCompressed(cstring, "{0}//{1}".FormateEx(CacheDir, CacheUtils.GenerateName(cw)), UseLZ78Compress);
        }
Exemple #3
0
 public static string GenerateName(WinterWrapUp cw)
 {
     return("cch_{3}_{0}_{1}{2}".FormateEx(cw.deletable ? "t" : "f", cw.uid, CACHE_FILE_EXT, cw.markName));
 }