Esempio n. 1
0
 public override void LoadFromXml(XmlElement xml)
 {
     base.LoadFromXml(xml);
     m_backup = new BackupContainer();
     m_backup.LoadFromXml_ForJob(xml.FindElement("Backup"));
     m_dst = (IDatabaseSource)DatabaseSourceAddonType.Instance.LoadAddon(xml.FindElement("Target"));
 }
Esempio n. 2
0
 public Backup_TreeNode(ITreeNode parent, IFileHandler fhandler)
     : base(parent, fhandler)
 {
     m_backup = new BackupContainer(m_file.DataDiskPath);
     if (parent is Backups_TreeNode)
     {
         m_conn = ((Backups_TreeNode)parent).m_conn;
     }
 }
Esempio n. 3
0
 public void Restore()
 {
     try
     {
         m_backup.Format.CheckRestoreConfiguration(m_conn);
         BackupContainer backup = new BackupContainer(m_file.DataDiskPath);
         RestoreDbForm.Run(m_conn.CloneSource(), backup);
     }
     catch (Exception err)
     {
         Errors.Report(err);
     }
 }
Esempio n. 4
0
        protected override void DoRun(IJobRunEnv env)
        {
            string dir = GetBackupDir();

            try { Directory.CreateDirectory(dir); }
            catch { }
            string          bckfile  = Path.Combine(dir, CreateFileName());
            IDatabaseWriter writer   = m_format.GetWriter(bckfile + m_format.Extension, m_src);
            var             copyOpts = new DatabaseCopyOptions
            {
                CopyMembers    = m_members,
                DataMode       = DbCopyDataMode.All,
                CopyStructure  = true,
                SchemaMode     = m_src.Dialect.DialectCaps.MultipleSchema ? DbCopySchemaMode.Original : DbCopySchemaMode.Explicit,
                ExplicitSchema = null
            };

            CopyDbJob.CopyDatabase(m_src, writer, ProgressInfo, copyOpts);
            SetCurWork(Texts.Get("s_finishing"));
            BackupContainer bc = new BackupContainer(bckfile, m_format);

            bc.Save();
        }
Esempio n. 5
0
 public static Job CreateJob(BackupContainer backup, IDatabaseSource dst, JobProperties jobProps)
 {
     return(Job.FromCommand(new RestoreDbJobCommand(backup, dst), jobProps));
 }
Esempio n. 6
0
 public RestoreDbJobCommand(BackupContainer backup, IDatabaseSource dst)
 {
     m_dst    = dst;
     m_backup = backup;
 }
Esempio n. 7
0
 public static void Run(IDatabaseSource conn, BackupContainer backup)
 {
     if (conn.Connection == null) return;
     var win = new RestoreDbForm(conn, backup);
     win.ShowDialogEx();
 }
Esempio n. 8
0
 public RestoreDbForm(IDatabaseSource conn, BackupContainer backup)
 {
     InitializeComponent();
     m_backup = backup;
     SetDatabase(conn);
 }