コード例 #1
0
        private void Restore(object sender, DoWorkEventArgs args)
        {
            //TODO: add a Try-Catch here
            Schedule s = m_wrapper.DataConnection.GetObjectById <Schedule>(m_wrapper.ScheduleID);

            RestoreTask task = new RestoreTask(s, m_wrapper.FullRestorePath, m_wrapper.RestoreFilter, m_wrapper.RestoreTime);
            Dictionary <string, string> options = new Dictionary <string, string>();
            string destination = task.GetConfiguration(options);

            if (options.ContainsKey("filter"))
            {
                options.Remove("filter");
            }

            using (Library.Main.Interface i = new Duplicati.Library.Main.Interface(destination, options))
            {
                i.OperationProgress += new Duplicati.Library.Main.OperationProgressEvent(i_OperationProgress);
                i.Restore(task.LocalPath.Split(System.IO.Path.PathSeparator));
            }
        }
コード例 #2
0
        private void Restore(object sender, DoWorkEventArgs args)
        {
            //TODO: add a Try-Catch here
            Schedule s = m_wrapper.DataConnection.GetObjectById<Schedule>(m_wrapper.ScheduleID);

            RestoreTask task = new RestoreTask(s, m_wrapper.FullRestorePath, m_wrapper.RestoreFilter, m_wrapper.RestoreTime);
            Dictionary<string, string> options = new Dictionary<string, string>();
            string destination = task.GetConfiguration(options);
            if (options.ContainsKey("filter"))
                options.Remove("filter");

            using (Library.Main.Interface i = new XervBackup.Library.Main.Interface(destination, options))
            {
                i.OperationProgress += new XervBackup.Library.Main.OperationProgressEvent(i_OperationProgress);
                i.Restore(task.LocalPath.Split(System.IO.Path.PathSeparator));
            }
        }