Пример #1
0
 public static void SaveBackups(List <IBackup> backups)
 {
     foreach (IBackup backup in backups)
     {
         IBackupFormat format = backup.GetFormat();
         format.Save(backup.GetFilePath(), backup);
     }
 }
Пример #2
0
 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"));
 }
Пример #3
0
        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"));
        }
Пример #4
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);
                }
            }
        }
Пример #5
0
        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;
        }
Пример #6
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);
                }
            }
        }
Пример #7
0
 public BackupDbJobCommand(IDatabaseSource src, IBackupFormat format, DatabaseStructureMembers members)
 {
     m_src     = src;
     m_format  = format;
     m_members = members;
 }
Пример #8
0
 public static Job CreateJob(IDatabaseSource src, IBackupFormat format, DatabaseStructureMembers members, JobProperties jobProps)
 {
     return(Job.FromCommand(new BackupDbJobCommand(src, format, members), jobProps));
 }
Пример #9
0
 public static void AddFormat(IBackupFormat format)
 {
     formats.Add(format);
 }
Пример #10
0
 public static void AddFormat(IBackupFormat format)
 {
     formats.Add(format);
 }
Пример #11
0
 public void LoadFromXml_ForJob(XmlElement xml)
 {
     this.LoadPropertiesCore(xml);
     m_filename = xml.FindElement("Filename").InnerText;
     Format     = (IBackupFormat)BackupFormatAddonType.Instance.LoadAddon(xml.FindElement("Format"));
 }
Пример #12
0
 public BackupContainer(string filename, IBackupFormat format)
 {
     m_filename = filename;
     Format     = format;
     Created    = DateTime.UtcNow;
 }
Пример #13
0
 private void addonSelectFrame1_ChangedSelectedObject(object sender, EventArgs e)
 {
     m_format = (IBackupFormat)addonSelectFrame1.SelectedObject;
 }