Exemple #1
0
 public static void Delete(SnapshotCategory sC)
 {
     if (sC != null)
     {
         sC.Delete();
     }
 }
Exemple #2
0
        public static string GetDirectory(string name)
        {
            try
            {
                var rpath = Snapshot.RepositoryPath;
                // sanitize name
                string fname = sanitize(name);
                string dir   = Path.Combine(rpath, fname);
                System.IO.Directory.CreateDirectory(dir);

                string namePath = Path.Combine(dir, NAMEFILE);

                if (!File.Exists(namePath))
                {
                    File.WriteAllText(namePath, name);
                    SnapshotCategory sC = new SnapshotCategory(dir);
                    sC.WriteSettings();
                }

                return(dir);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Exemple #3
0
        public static string Store <T>(T[] data, string name, string sub = null)
        {
            string filename = SnapshotCategory.Store(data, name, sub);

            if (filename == null)
            {
                return(null);
            }
            return(filename);
        }
Exemple #4
0
        // organize
        // by name
        // per name, max number of

        public static List <SnapshotCategory> GetCollection()
        {
            var subPaths = Directory.GetDirectories(RepositoryPath);

            List <SnapshotCategory> ret = new List <SnapshotCategory>();

            foreach (var subPath in subPaths)
            {
                SnapshotCategory sC = new SnapshotCategory(subPath);
                if (sC.State)
                {
                    ret.Add(sC);
                }
            }


            return(ret);
        }