Beispiel #1
0
        private static bool AddMedia(string filename, MediaType mediaType)
        {
            bool flag = false;

            try
            {
                if (Directory.Exists(filename))
                {
                    flag  = AddMedia(Directory.GetFiles(filename), mediaType);
                    flag |= AddMedia(Directory.GetDirectories(filename), mediaType);
                }
                else if (ZuneLibrary.CanAddMedia(filename, (EMediaTypes)mediaType))
                {
                    flag = ZuneLibrary.AddMedia(filename) != -1;
                }
            }
            catch (UnauthorizedAccessException ex)
            {
            }
            catch (IOException ex)
            {
            }
            return(flag);
        }
 public void AddTrackToDatabase(string filePath)
 {
     _zuneLibrary.AddMedia(filePath);
 }