public static void SaveBackups(List <IBackup> backups) { foreach (IBackup backup in backups) { IBackupFormat format = backup.GetFormat(); format.Save(backup.GetFilePath(), backup); } }
public override void LoadFromXml(XmlElement xml) { base.LoadFromXml(xml); m_format = (IBackupFormat)BackupFormatAddonType.Instance.LoadAddon(xml.FindElement("Format")); m_members = new DatabaseStructureMembers(); m_members.LoadFromXml_ForJob(xml.FindElement("Members")); m_src = (IDatabaseSource)DatabaseSourceAddonType.Instance.LoadAddon(xml.FindElement("Source")); }
public BackupContainer(string filename) { m_filename = filename; XmlDocument doc = new XmlDocument(); doc.Load(filename); this.LoadPropertiesCore(doc.DocumentElement); Format = (IBackupFormat)BackupFormatAddonType.Instance.LoadAddon(doc.DocumentElement.FindElement("Format")); }
public static void LoadPlugin(string file) { Assembly assembly = Assembly.LoadFile(file); foreach (Type t in assembly.GetTypes()) { if (typeof(IBackupFormat).IsAssignableFrom(t)) { IBackupFormat format = Activator.CreateInstance(t) as IBackupFormat; BackupLoader.formats.Add(format); } } }
public BackupDbForm(IDatabaseSource source) { InitializeComponent(); m_source = source; m_format = (IBackupFormat)addonSelectFrame1.SelectedObject; // set here, not in designer so that filtering is applied addonSelectFrame1.AddonTypeName = "bakformat"; //selectTemplateComboFrame1.Configure(BackupFormatAddonType.Instance.CommonSpace, null, "dbk_backup", null); //selectTemplateComboFrame1.Enabled = true; //RecreateBackupFormat(); //selectTemplateComboFrame1.SelectedIndex = 0; }
public static void LoadPlugin(string file) { Assembly assembly = Assembly.LoadFile(file); foreach (Type t in assembly.GetTypes()) { if (typeof(IBackupFormat).IsAssignableFrom(t)) { IBackupFormat format = Activator.CreateInstance(t) as IBackupFormat; BackupLoader.formats.Add(format); } if (typeof(IUpdater).IsAssignableFrom(t)) { IUpdater updater = Activator.CreateInstance(t) as IUpdater; updater.SetPath(file); DataHolder.AddUpdater(updater); } if (typeof(IPlugin).IsAssignableFrom(t)) { IPlugin plugin = Activator.CreateInstance(t) as IPlugin; DataHolder.AddPlugin(plugin); } } }
public BackupDbJobCommand(IDatabaseSource src, IBackupFormat format, DatabaseStructureMembers members) { m_src = src; m_format = format; m_members = members; }
public static Job CreateJob(IDatabaseSource src, IBackupFormat format, DatabaseStructureMembers members, JobProperties jobProps) { return(Job.FromCommand(new BackupDbJobCommand(src, format, members), jobProps)); }
public static void AddFormat(IBackupFormat format) { formats.Add(format); }
public void LoadFromXml_ForJob(XmlElement xml) { this.LoadPropertiesCore(xml); m_filename = xml.FindElement("Filename").InnerText; Format = (IBackupFormat)BackupFormatAddonType.Instance.LoadAddon(xml.FindElement("Format")); }
public BackupContainer(string filename, IBackupFormat format) { m_filename = filename; Format = format; Created = DateTime.UtcNow; }
private void addonSelectFrame1_ChangedSelectedObject(object sender, EventArgs e) { m_format = (IBackupFormat)addonSelectFrame1.SelectedObject; }