public void Save(string file, IBackup backup) { BinaryWriter bw = new BinaryWriter(new FileStream(file, FileMode.OpenOrCreate)); bw.Write(signature); bw.Write(backup.GetName()); bw.Write(backup.GetDescription()); bw.Write((backup as Backup_Jar).GetData()); }
public static void RemoveBackup(IBackup backup) { File.Delete(backups.Find(b => b.GetName() == backup.GetName()).GetFilePath()); backups.Remove(backup); }
public void Save(string file, IBackup backup) { byte[] jardata = (backup as Backup_Jar).GetData(); BinaryWriter bw = new BinaryWriter(new FileStream(file, FileMode.OpenOrCreate)); bw.Write(signature); bw.Write(backup.GetName()); bw.Write(backup.GetDescription()); bw.Write(jardata.Length); bw.Write(jardata); bw.Close(); }