Exemple #1
0
        public DirectoryTreeFileData AddFile(string name)
        {
            var file = new DirectoryTreeFileData(this, name);

            _files.Add(file);
            return(file);
        }
        private ItemStatus GetFileStatus(DirectoryTreeFileData fileData)
        {
            if (fileData.Target is null)
            {
                return(ItemStatus.ItemToCopy);
            }

            if (fileData.Source is null)
            {
                return(ItemStatus.ItemToRemove);
            }

            if (fileData.Source.Size != fileData.Target.Size ||
                fileData.Source.Checksum != fileData.Target.Checksum)
            {
                return(ItemStatus.ItemToUpdate);
            }

            return(ItemStatus.ItemAlreadyPresent);
        }