Пример #1
0
        /// <summary>
        /// Initalises the backup set.
        /// </summary>
        /// <param name="paths">The paths.</param>
        /// <returns></returns>
        private static List <BakModel> InitaliseBackupSet(IEnumerable <string> paths)
        {
            var backupSet = new List <BakModel>();

            foreach (var path in paths)
            {
                BakModel model;

                if (!BakFilenameExtractor.ValidateFilenameAndExtract(path, out model))
                {
                    continue;
                }

                backupSet.Add(model);
            }

            return(backupSet);
        }
Пример #2
0
        /// <summary>
        /// Maps the specified paths to a list of backup models.
        /// </summary>
        /// <param name="paths">The paths.</param>
        /// <returns></returns>
        protected IList <BakModel> ToBakModels(IEnumerable <KeyValuePair <string, long> > paths)
        {
            var files = new List <BakModel>();

            foreach (var pathAndSize in paths)
            {
                BakModel model;

                if (!BakFilenameExtractor.ValidateFilenameAndExtract(pathAndSize.Key, out model))
                {
                    continue;
                }

                model.Size = pathAndSize.Value;

                files.Add(model);
            }

            return(files);
        }