private static void AddDirectory(string directoryPath, ZipArchive archive, ZipContext context) { foreach (string filePath in TexoDirectory.GetFiles(directoryPath)) { AddFile(filePath, archive, context); } }
private void CopyDirectory(string directoryPath, CopyContext context) { foreach (string filePath in TexoDirectory.GetFiles(directoryPath)) { CopyFile(filePath, context); } }
private void SearchDirectory(string directoryPath, SearchContext context) { foreach (string filePath in TexoDirectory.GetFiles(directoryPath)) { SearchFile(filePath, context); } }
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)); } }
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); } } }
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); }
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); }