public RecoveryPoint(Dictionary <string, TypeObject> resources, string preffix, TypeStorage ts, TypeRestPoint trp) { this.resources = new Dictionary <string, TypeObject>(resources); date = TrimDate(DateTime.Now, TimeSpan.TicksPerSecond); name = String.Format("{0}{1}", preffix, date.ToString("dd_MM_yyyy_HH_mm_ss")); typeStorage = ts; typeRestPoint = trp; if (!Directory.Exists(name)) { Directory.CreateDirectory(name); } }
public bool CreateRestPoint(TypeRestPoint typeRestPoint, TypeStorage typeStorage) { var rp = new RecoveryPoint(files, string.Format("{0}\\myrp_", name), typeStorage, typeRestPoint); var p = rest_points.Keys; if ((typeRestPoint == TypeRestPoint.Full && rp.AddFullRP()) || (typeRestPoint == TypeRestPoint.Part && rp.AddPartRP(p.Count > 0 ? rest_points[p.Max()] : null))) { rest_points.Add(rp.date, rp); return(true); } return(false); }