2 using System.Collections.Generic;
12 public static class DirectoryInfoExtensions
18 public static void CreateDirectoryPath(
this DirectoryInfo DI)
20 if (DI.Exists)
return;
21 if (DI.Parent != null)
23 CreateDirectoryPath(DI.Parent);
36 public static DirectoryInfo AppendPath(
this DirectoryInfo DI,
string PathToAppend)
38 return new DirectoryInfo(Path.Combine(DI.FullName, PathToAppend));
43 public static bool CheckExists(
this DirectoryInfo DI)
45 return new DirectoryInfo(DI.FullName).Exists;
48 public static void DeleteAllDirectories(
this DirectoryInfo DI)
50 foreach (DirectoryInfo D
in DI.GetDirectories())
64 public static void DeleteAllFiles(
this DirectoryInfo DI)
66 foreach (FileInfo FI
in DI.GetFiles())