Esempio n. 1
0
 private void ExploreDirectories()
 {
     if (!object.ReferenceEquals(this.Drive, null))
     {
         if (!this.Drive.IsReady)
         {
             return;
         }
     }
     try
     {
         if (this.FileSystemInfo is DirectoryInfo)
         {
             var directories = ((DirectoryInfo)this.FileSystemInfo).GetDirectories();
             foreach (var directory in directories.OrderBy(d => d.Name))
             {
                 if (!object.Equals((directory.Attributes & FileAttributes.System), FileAttributes.System) &&
                     !object.Equals((directory.Attributes & FileAttributes.Hidden), FileAttributes.Hidden))
                 {
                     var fso = new FileSystemObjectInfo(directory);
                     fso.BeforeExplore += Fso_BeforeExplore;
                     fso.AfterExplore  += Fso_AfterExplore;
                     this.Children.Add(fso);
                 }
             }
         }
     }
     catch
     {
         /*throw;*/
     }
 }
Esempio n. 2
0
 private void ExploreDirectories()
 {
     if (Drive?.IsReady == false)
     {
         return;
     }
     if (FileSystemInfo is DirectoryInfo)
     {
         var directories = ((DirectoryInfo)FileSystemInfo).GetDirectories();
         foreach (var directory in directories.OrderBy(d => d.Name))
         {
             if ((directory.Attributes & FileAttributes.System) != FileAttributes.System)
             {
                 var fileSystemObject = new FileSystemObjectInfo(directory);
                 fileSystemObject.BeforeExplore += FileSystemObject_BeforeExplore;
                 fileSystemObject.AfterExplore  += FileSystemObject_AfterExplore;
                 Children.Add(fileSystemObject);
             }
         }
     }
 }
Esempio n. 3
0
 private void ExploreFiles()
 {
     if (Drive?.IsReady == false)
     {
         return;
     }
     if (FileSystemInfo is DirectoryInfo)
     {
         var files = ((DirectoryInfo)FileSystemInfo).GetFiles();
         foreach (var file in files.OrderBy(d => d.Name))
         {
             if ((file.Attributes & FileAttributes.System) != FileAttributes.System)
             {
                 var folder = new FileSystemObjectInfo(file);
                 if (folder is DirectoryInfo)
                 {
                     Children.Add(folder);
                 }
             }
         }
     }
 }
Esempio n. 4
0
 private void ExploreDirectories()
 {
     if (Drive?.IsReady == false)
     {
         return;
     }
     if (FileSystemInfo is DirectoryInfo)
     {
         var subdirs = ((DirectoryInfo)FileSystemInfo).GetDirectories(); // Returns the subdirectories of the current directory.
         foreach (var directory in subdirs.OrderBy(d => d.Name))
         {
             if ((directory.Attributes & FileAttributes.System) != FileAttributes.System &&
                 (directory.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden &&
                 !IsRepoDir(directory))
             {
                 var fileSystemObject = new FileSystemObjectInfo(directory, ref filelist);
                 fileSystemObject.BeforeExplore += FileSystemObject_BeforeExplore;
                 fileSystemObject.AfterExplore  += FileSystemObject_AfterExplore;
                 Children.Add(fileSystemObject);
             }
         }
     }
 }