예제 #1
0
 private static void AddDirectory(string directoryPath, ZipArchive archive, ZipContext context)
 {
     foreach (string filePath in TexoDirectory.GetFiles(directoryPath))
     {
         AddFile(filePath, archive, context);
     }
 }
예제 #2
0
 private void CopyDirectory(string directoryPath, CopyContext context)
 {
     foreach (string filePath in TexoDirectory.GetFiles(directoryPath))
     {
         CopyFile(filePath, context);
     }
 }
예제 #3
0
 private void SearchDirectory(string directoryPath, SearchContext context)
 {
     foreach (string filePath in TexoDirectory.GetFiles(directoryPath))
     {
         SearchFile(filePath, context);
     }
 }
예제 #4
0
        private IEnumerable <IItem> BuildFromDirectory(string directory, string filter)
        {
            foreach (string directoryName in TexoDirectory.GetDirectories(directory, filter))
            {
                string justName = directoryName.GetFileNameOrDirectoryName();
                yield return(Item.AsIntellisense(justName, directoryName + System.IO.Path.DirectorySeparatorChar, "directory", null));
            }

            foreach (string fileName in TexoDirectory.GetFiles(directory, filter))
            {
                string justName = fileName.GetFileNameOrDirectoryName();
                yield return(Item.AsIntellisense(justName, fileName, "file", null));
            }
        }
예제 #5
0
        private static void ProcessDirectories(TexoPath path, Action <string> projectAction, ISet <string> visitedFiles)
        {
            foreach (string directory in path.GetDirectories())
            {
                foreach (string solutionFile in TexoDirectory.GetFiles(directory, PathConstants.ANY_PATH_WILDCARD + FILE_EXTENSION_SOLUTION, SearchOption.AllDirectories))
                {
                    ProcessSolution(solutionFile, projectAction, visitedFiles);
                }

                foreach (string projectFile in TexoDirectory.GetFiles(directory, PathConstants.ANY_PATH_WILDCARD + FILE_EXTENSION_PROJECT, SearchOption.AllDirectories))
                {
                    ProcessProjectFile(projectFile, projectAction, visitedFiles);
                }
            }
        }
예제 #6
0
        private void MoveDirectory(string directoryPath, MoveContext context)
        {
            foreach (string filePath in TexoDirectory.GetFiles(directoryPath))
            {
                MoveFile(filePath, context);
            }

            if (context.Preview ||
                !TexoDirectory.IsEmpty(directoryPath))
            {
                return;
            }

            Directory.Delete(directoryPath);
        }
예제 #7
0
        private void DeleteDirectory(string directoryPath, DeleteContext context)
        {
            foreach (string filePath in TexoDirectory.GetFiles(directoryPath))
            {
                DeleteFile(filePath, context);
            }

            if (context.Preview ||
                !TexoDirectory.IsEmpty(directoryPath))
            {
                return;
            }

            context.DeletedFolders.Add(directoryPath.GetFriendlyPath(context.SourceLobby));
            ProcessDirectoryDelete(directoryPath);
        }