Example #1
0
        private IEnumerable <KeyValuePair <string, FileStatus> > PrepareBatch(IEnumerable <string> paths)
        {
            Ensure.ArgumentNotNull(paths, "paths");

            IDictionary <string, FileStatus> dic = new Dictionary <string, FileStatus>();

            foreach (string path in paths)
            {
                if (string.IsNullOrEmpty(path))
                {
                    throw new ArgumentException("At least one provided path is either null or empty.", "paths");
                }

                string     relativePath = repo.BuildRelativePathFrom(path);
                FileStatus fileStatus   = RetrieveStatus(relativePath);

                dic.Add(relativePath, fileStatus);
            }

            if (dic.Count == 0)
            {
                throw new ArgumentException("No path has been provided.", "paths");
            }

            return(dic);
        }
Example #2
0
        private static FilePath[] ToFilePaths(Repository repo, IEnumerable <string> paths)
        {
            if (paths == null)
            {
                return(null);
            }

            var filePaths = new List <FilePath>();

            foreach (string path in paths)
            {
                if (string.IsNullOrEmpty(path))
                {
                    throw new ArgumentException("At least one provided path is either null or empty.", "paths");
                }

                filePaths.Add(repo.BuildRelativePathFrom(path));
            }

            if (filePaths.Count == 0)
            {
                throw new ArgumentException("No path has been provided.", "paths");
            }

            return(filePaths.ToArray());
        }
Example #3
0
        private Tuple <string, FileStatus> BuildFrom(string path)
        {
            string relativePath = repo.BuildRelativePathFrom(path);

            return(new Tuple <string, FileStatus>(relativePath, RetrieveStatus(relativePath)));
        }
Example #4
0
        private static FilePath[] ToFilePaths(Repository repo, IEnumerable<string> paths)
        {
            if (paths == null)
            {
                return null;
            }

            var filePaths = new List<FilePath>();

            foreach (string path in paths)
            {
                if (string.IsNullOrEmpty(path))
                {
                    throw new ArgumentException("At least one provided path is either null or empty.", "paths");
                }

                filePaths.Add(repo.BuildRelativePathFrom(path));
            }

            if (filePaths.Count == 0)
            {
                throw new ArgumentException("No path has been provided.", "paths");
            }

            return filePaths.ToArray();
        }