Exemplo n.º 1
0
        public static EtoDirectoryInfo GetDirectory(string path)
        {
            if (!Path.IsPathRooted(path))
            {
                path = Path.GetFullPath(path);
            }
            var pathRoot = Path.GetPathRoot(path);

            path = path.Substring(pathRoot.Length);
            string[] paths = path.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);

            EtoDirectoryInfo di = new DiskDirectoryInfo(pathRoot);

            foreach (string dir in paths)
            {
                di = di.GetSubDirectory(dir);
                if (di == null)
                {
                    break;
                }
            }
            return(di);
        }
Exemplo n.º 2
0
		public EtoDriveInfo(DriveInfo drive)
		{
			this.drive = drive;
			this.directory = new DiskDirectoryInfo(drive.RootDirectory);
		}
Exemplo n.º 3
0
 public EtoDriveInfo(DriveInfo drive)
 {
     this.drive     = drive;
     this.directory = new DiskDirectoryInfo(drive.RootDirectory);
 }