Exemplo n.º 1
0
 private void EnumerateFiles(ref List <string> folders, VSTVersion version, DirectoryInfo dir)
 {
     try
     {
         //dirs
         DirectoryInfo[] dirs = dir.GetDirectories("*", SearchOption.TopDirectoryOnly);
         foreach (DirectoryInfo di in dirs)
         {
             if (IsValid(di.Attributes, di.FullName))
             {
                 if (version == VSTVersion.vst2 &&
                     (di.FullName.EndsWith("\\vst2", StringComparison.InvariantCultureIgnoreCase) ||
                      di.FullName.EndsWith("\\vstplugins", StringComparison.InvariantCultureIgnoreCase)))
                 {
                     folders.Add(di.FullName);
                 }
                 else if (version == VSTVersion.vst3 && di.FullName.EndsWith("\\vst3", StringComparison.InvariantCultureIgnoreCase))
                 {
                     folders.Add(di.FullName);
                 }
                 else
                 {
                     EnumerateFiles(ref folders, version, di);
                 }
             }
         }
     }
     catch (UnauthorizedAccessException)
     {
         _pref.ExcludedFolders.Add(dir.FullName.ToLower());
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Exemplo n.º 2
0
 private void DirSearch(ref List <string> folders, List <DirectoryInfo> roots, VSTVersion version)
 {
     foreach (DirectoryInfo di in roots)
     {
         EnumerateFiles(ref folders, version, di);
     }
 }