internal static bool ImportEachFileInDirectory
            (IMLSection section,
            ref ArrayList extensionsToIgnore,
            ref string[] filmLocations,
            string[] videoExtensions,
            string[] audioExtensions,
            int totalFiles,
            ref int currentFile,
            IEnumerable <string> combinedSceneTags,
            ArrayList filesInDirectory,
            string pluginPath,
            IEnumerable <string> videoExtensionsCommon)
        {
            foreach (FileInfo file in filesInDirectory)
            {
                Application.DoEvents();


                if (!SingleMediaFileImporter.ImportMediaFile
                        (file, section,
                        ref extensionsToIgnore,
                        ref filmLocations,
                        videoExtensions,
                        audioExtensions,
                        totalFiles,
                        ref currentFile,
                        combinedSceneTags,
                        pluginPath,
                        videoExtensionsCommon))
                {
                    return(false);
                }
            }


            return(true);
        }
示例#2
0
        private static bool ImportFilesInArray
            (IMLSection section,
            ref ArrayList extensionsToIgnore,
            string[] filmLocations,
            string[] videoExtensions,
            string[] audioExtensions,
            IEnumerable <string> combinedSceneTags,
            ICollection <FileInfo> filesToImport,
            string pluginPath,
            IEnumerable <string> videoExtensionsCommon)
        {
            if (filesToImport.Count <= 0)
            {
                return(true);
            }

            int currentFile = 0;



            foreach (FileInfo file in filesToImport)
            {
                Application.DoEvents();


                if (SingleMediaFileImporter
                    .ImportMediaFile
                        (file,
                        section,
                        ref extensionsToIgnore,
                        ref filmLocations,
                        videoExtensions,
                        audioExtensions,
                        filesToImport.Count,
                        ref currentFile,
                        combinedSceneTags,
                        pluginPath,
                        videoExtensionsCommon))
                {
                    continue;
                }



                ImportingEngineHelpers
                .EndUpdatingSections
                    (section);



                MainImportingEngine.
                CurrentProgress = 100;



                Helpers.UpdateProgress
                    ("All operations were cancelled." +
                    " Completed jobs were save to library.", "");



                MainImportingEngine
                .ThisProgress = null;



                return(false);
            }


            return(true);
        }