Ejemplo n.º 1
0
        static void deleteOldBackUps_NOTUSED_DEMO_ONLY()
        {
            return;

#if DEBUG
            var keepCnt = 64;
#else
            int keepCnt = 32;
#endif

#if ISO
            var dir = IsoHelper.GetIsoFolder();
#else
            var dir = Path.GetDirectoryName(MainVmJsonFile);
#endif
            var all = new DirectoryInfo(dir).GetFiles($@"{typeof(MainVM).Name}.{DateTime.Now:yy.}*{_ext}");
            var ttl = all.Count();
            if (ttl <= keepCnt)
            {
                return;
            }

            var del = all.OrderBy(r => r.LastWriteTime).Take(ttl - keepCnt);

            Debug.WriteLine($@">>Deleting: {dir}    {typeof(MainVM).Name}.{DateTime.Now:yy.}*{_ext}     { del.Count()} / {all.Count()}");

            foreach (var f in del)
            {
                Debug.WriteLine($">>Deleting: {f}"); f.Delete();
            }
        }
Ejemplo n.º 2
0
 void onF7(object o)
 {
     Process.Start("Explorer.exe", IsoHelper.GetIsoFolder());
 }