Esempio n. 1
0
 private static bool CanAddMedia(string filename, MediaType mediaType, CanAddMediaArgs args)
 {
     try
     {
         return(Directory.Exists(filename) ? ZuneLibrary.CanAddFromFolder(filename) && (CanAddMedia(Directory.GetFiles(filename), mediaType, args) || CanAddMedia(Directory.GetDirectories(filename), mediaType, args)) : ZuneLibrary.CanAddMedia(filename, (EMediaTypes)mediaType));
     }
     catch (UnauthorizedAccessException ex)
     {
         return(false);
     }
     catch (IOException ex)
     {
         return(false);
     }
 }
Esempio n. 2
0
 internal static bool CanAddMedia(IList filenames, MediaType mediaType, CanAddMediaArgs args)
 {
     foreach (string filename in filenames)
     {
         if (args.Aborted)
         {
             return(false);
         }
         if (CanAddMedia(filename, mediaType, args))
         {
             return(true);
         }
     }
     return(false);
 }