public override void Execute() { string[] dirNamesArr = DirFileUtilities.GetDirectoriesNames(PathTracker.GetInstance().ToString()); string[] fileNamesArr = DirFileUtilities.GetFileNames(PathTracker.GetInstance().ToString()); MethodsOutput.PrintLocalStringLine("DIRECTORIES"); if (dirNamesArr.Length > 0) { MethodsOutput.PrintArray(dirNamesArr); } else { MethodsOutput.PrintLocalStringLine("NO_DIRECTORIES"); } MethodsOutput.SkipLine(); MethodsOutput.PrintLocalStringLine("FILES"); if (fileNamesArr.Length > 0) { MethodsOutput.PrintArray(fileNamesArr); } else { MethodsOutput.PrintLocalStringLine("NO_FILES"); } }
/// <summary> /// Concatenate files (<paramref name="paths" />) and print them. /// </summary> /// <param name="paths"> Files' paths. </param> public static void PrintConcatFiles(params string[] paths) { List <string> fileResList = new List <string>(); foreach (var path in paths) { fileResList.AddRange(FileReadLines(path, Encoding.UTF8)); } MethodsOutput.PrintArray(fileResList.ToArray()); }
public override void Execute() { string[] drives = Directory.GetLogicalDrives(); MethodsOutput.PrintArray(drives); }