Exemple #1
0
        public void Run(List <string> args, Action <Duplicati.Library.Interface.IListAffectedResults> callback = null)
        {
            if (!System.IO.File.Exists(m_options.Dbpath))
            {
                throw new UserInformationException(string.Format("Database file does not exist: {0}", m_options.Dbpath), "DatabaseDoesNotExist");
            }

            using (var db = new Database.LocalListAffectedDatabase(m_options.Dbpath))
            {
                m_result.SetDatabase(db);
                if (callback == null)
                {
                    m_result.SetResult(
                        db.GetFilesets(args).OrderByDescending(x => x.Time).ToArray(),
                        db.GetFiles(args).ToArray(),
                        db.GetLogLines(args).ToArray(),
                        db.GetVolumes(args).ToArray()
                        );
                }
                else
                {
                    m_result.SetResult(
                        db.GetFilesets(args).OrderByDescending(x => x.Time),
                        db.GetFiles(args),
                        db.GetLogLines(args),
                        db.GetVolumes(args)
                        );

                    callback(m_result);
                }
            }
        }
Exemple #2
0
        public void Run(List <string> args, Action <Duplicati.Library.Interface.IListAffectedResults> callback = null)
        {
            using (var db = new Database.LocalListAffectedDatabase(m_options.Dbpath))
            {
                m_result.SetDatabase(db);
                if (callback == null)
                {
                    m_result.SetResult(
                        db.GetFilesets(args).OrderByDescending(x => x.Time).ToArray(),
                        db.GetFiles(args).ToArray(),
                        db.GetLogLines(args).ToArray(),
                        db.GetVolumes(args).ToArray()
                        );
                }
                else
                {
                    m_result.SetResult(
                        db.GetFilesets(args).OrderByDescending(x => x.Time),
                        db.GetFiles(args),
                        db.GetLogLines(args),
                        db.GetVolumes(args)
                        );

                    callback(m_result);
                }
            }
        }
Exemple #3
0
 public void Run(List <string> args)
 {
     using (var db = new Database.LocalListAffectedDatabase(m_options.Dbpath))
     {
         m_result.SetDatabase(db);
         m_result.SetResult(
             db.GetFilesets(args).OrderByDescending(x => x.Time).ToArray(),
             db.GetFiles(args).ToArray(),
             db.GetLogLines(args).ToArray(),
             db.GetVolumes(args).ToArray()
             );
     }
 }