示例#1
0
        public void Add([NotNull] FtpSummary other)
        {
            if (other == null)
            {
                throw new ArgumentNullException(nameof(other));
            }

            Deleted.AddRange(other.Deleted);
            DeletedDirectories.AddRange(other.DeletedDirectories);
            CreatedDirectories.AddRange(other.CreatedDirectories);
            UpdatedFiles.AddRange(other.UpdatedFiles);
            CreatedFiles.AddRange(other.CreatedFiles);
            CreatedFiles = CreatedFiles.Except(UpdatedFiles).ToList();
            IgnoredFiles.AddRange(other.IgnoredFiles);
            IgnoredDirectories.AddRange(other.IgnoredDirectories);
        }
示例#2
0
        public static void SlamItOut(Dictionary <string, TagHelper> tagsToChange, Dictionary <int, CountryMergeHelper> statesToChangeOwnership,
                                     ProvincesToChange provincesToChange, List <Ideology> ideologies, string directory, int level)
        {
            DirectoryInfo directoryInfo = new DirectoryInfo(directory);

            if (IgnoredDirectories.Contains(directoryInfo.Name))
            {
                return;
            }
            else
            {
                DirectoryInfo[]      directories    = directoryInfo.GetDirectories();
                List <DirectoryInfo> bestFuckinList = new List <DirectoryInfo>();

                if (directories != null && directories.Length > 0)
                {
                    for (int i = 0; i < directories.Length; i++)
                    {
                        bestFuckinList.Add(directories[i]);
                    }
                    //LEVEL ONE
                    if (bestFuckinList.Count > 0)
                    {
                        foreach (DirectoryInfo di in bestFuckinList)
                        {
                            SlamItOut(tagsToChange, statesToChangeOwnership, provincesToChange, ideologies, di.FullName, level + 1);
                        }
                    }
                }
                FileInfo[]      filesRaw = directoryInfo.GetFiles();
                List <FileInfo> files    = new List <FileInfo>();

                for (int i = 0; i < filesRaw.Length; i++)
                {
                    files.Add(filesRaw[i]);
                }
                foreach (FileInfo fi in files)
                {
                    ProcessFile(fi, level, directoryInfo, tagsToChange, statesToChangeOwnership, provincesToChange, ideologies);
                }
            }
        }
示例#3
0
        public void Run()
        {
            if (string.IsNullOrEmpty(SourceDirectory))
            {
                throw new ArgumentNullException(nameof(SourceDirectory));
            }

            if (string.IsNullOrEmpty(DestinationDirectory))
            {
                throw new ArgumentNullException(nameof(DestinationDirectory));
            }

            if (!Provider.DirectoryExists(SourceDirectory))
            {
                throw new ApplicationException($"Source directory '{SourceDirectory}' does not exist!");
            }

            var ignoredPaths = IgnoredDirectories
                               .Select(x => x.Split(Provider.DirectorySeparatorChar))
                               .ToArray();

            CopyInner(SourceDirectory, DestinationDirectory, ignoredPaths);
        }
 public bool HasIgnoredDirectory(string path)
 {
     return(path.Split(Path.DirectorySeparatorChar).Any(x => IgnoredDirectories.Contains(x)));
 }
示例#5
0
 bool ShouldIgnoreDirectory(string path)
 {
     return(IgnoredDirectories.Contains(path) || IgnoredDirectories.Contains(Path.GetFileName(path)));
 }