Пример #1
0
 //----------------------------------------------------------------------------------------------------------------------
 public override void FindChields()
 {
     if (drive.IsReady)
     {
         foreach (DirectoryInfo dir in drive.RootDirectory.GetDirectories())
         {
             DirectoryElementViewModel item = new DirectoryElementViewModel(dir);
             Chields.Add(item);
         }
     }
 }
Пример #2
0
 //----------------------------------------------------------------------------------------------------------------------
 public override void FindChields()
 {
     try
     {
         foreach (DirectoryInfo dir in directory.GetDirectories())
         {
             DirectoryElementViewModel item = new DirectoryElementViewModel(dir);
             Chields.Add(item);
         }
     }
     catch (UnauthorizedAccessException e)
     {
         Console.Write(e.Message);
     }
     catch (DirectoryNotFoundException ed)
     {
         Console.Write(ed.Message);
     }
 }