public override void WriteStructureAfterData(IDatabaseStructure db) { var index_e = m_zip.PutNextEntry("_index_.xml"); var dbcopy = new DatabaseStructure(db); dbcopy.Save(m_zip); }
public override void RunCommand() { if (Format == null) { if (Outfile.EndsWith(".dbk")) { Format = "dbk"; } else if (Outfile.EndsWith(".ddf")) { Format = "ddf"; } else { throw new CommandLineError("DAE-00151 Unknown output format, cannot be deduced from file extension"); } } IDatabaseSource db = m_connection.GetConnection(); Async.SafeOpen(db.Connection); try { switch (Format) { case "ddf": { var s = new DatabaseStructure(db.InvokeLoadStructure(DatabaseStructureMembers.FullStructure, null)); s.Save(Outfile); } break; case "dbk": { DataArchiveWriter dw = new DataArchiveWriter(); dw.FilePlace = FilePlaceAddonType.PlaceFromVirtualFile(Outfile); CopyDbJob.CopyDatabase(db, dw, null, new DatabaseCopyOptions { CopyMembers = DatabaseStructureMembers.FullStructure }); Async.SafeClose(db.Connection); } break; default: throw new CommandLineError("DAE-00152 Unknown format:" + Format); } } finally { Async.SafeClose(db.Connection); } }