예제 #1
0
 public FileSistem(string path)
 {
     if ((path != null)&&(path!="undefined"))
     {
         
         try
         {
             DirSearch(path);
             currentPath = path;
             var dir = new DirectoryInfo(path);
             string[] FoldersInDir = Directory.GetDirectories(path);
             Folder[] newFolderInfo = new Folder[FoldersInDir.Length];
             for (int i = 0; i < FoldersInDir.Length; i++)
             {
                 newFolderInfo[i].FullPath = FoldersInDir[i];
                 newFolderInfo[i].OriginalPath = GetName(FoldersInDir[i], path);
             }
             FolderInfo = newFolderInfo;
             string[] files = Directory.GetFiles(path);
             for (int i = 0; i < Directory.GetFiles(path).Length; i++)
             {
                 files[i] = GetName(files[i], path);
             }
             FilesInFolder = files;
             PrevPath = GetPrev(path);
         }
         catch {
             if (path.Length < 4) 
             {
                 FileSistem Fs = new FileSistem();
                 this.allDrives = Fs.allDrives;
                 this.currentPath = Fs.currentPath;
                 this.FilesLess10 = Fs.FilesLess10;
                 this.FilesLess50More10 = Fs.FilesLess50More10;
                 this.FilesMore100 = Fs.FilesMore100;
                 this.PrevPath = Fs.PrevPath;
             }
         
         }
     }
     else
     {
         FileSistem Fs = new FileSistem();
         this.allDrives = Fs.allDrives;
         this.currentPath = Fs.currentPath;
         this.FilesLess10 = Fs.FilesLess10;
         this.FilesLess50More10 = Fs.FilesLess50More10;
         this.FilesMore100 = Fs.FilesMore100;
         this.PrevPath = Fs.PrevPath;
     }
 }
예제 #2
0
 public FileSistem(string path)
 {
     if ((path != null) && (path != "undefined"))
     {
         try
         {
             DirSearch(path);
             currentPath = path;
             var      dir           = new DirectoryInfo(path);
             string[] FoldersInDir  = Directory.GetDirectories(path);
             Folder[] newFolderInfo = new Folder[FoldersInDir.Length];
             for (int i = 0; i < FoldersInDir.Length; i++)
             {
                 newFolderInfo[i].FullPath     = FoldersInDir[i];
                 newFolderInfo[i].OriginalPath = GetName(FoldersInDir[i], path);
             }
             FolderInfo = newFolderInfo;
             string[] files = Directory.GetFiles(path);
             for (int i = 0; i < Directory.GetFiles(path).Length; i++)
             {
                 files[i] = GetName(files[i], path);
             }
             FilesInFolder = files;
             PrevPath      = GetPrev(path);
         }
         catch {
             if (path.Length < 4)
             {
                 FileSistem Fs = new FileSistem();
                 this.allDrives         = Fs.allDrives;
                 this.currentPath       = Fs.currentPath;
                 this.FilesLess10       = Fs.FilesLess10;
                 this.FilesLess50More10 = Fs.FilesLess50More10;
                 this.FilesMore100      = Fs.FilesMore100;
                 this.PrevPath          = Fs.PrevPath;
             }
         }
     }
     else
     {
         FileSistem Fs = new FileSistem();
         this.allDrives         = Fs.allDrives;
         this.currentPath       = Fs.currentPath;
         this.FilesLess10       = Fs.FilesLess10;
         this.FilesLess50More10 = Fs.FilesLess50More10;
         this.FilesMore100      = Fs.FilesMore100;
         this.PrevPath          = Fs.PrevPath;
     }
 }
 public FileSistem Get(string name)
 {
     var FS = new FileSistem(name);
     return FS;
 }
 public  FileSistem Get()
 {
     var FS = new FileSistem();
     return FS;
 }