public static void Delete(SnapshotCategory sC) { if (sC != null) { sC.Delete(); } }
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); } }
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); }
// 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); }