示例#1
0
        public AudioScan RunScannerAsync(string[] ignoreFiles)
        {
            if (!_directory.Exists)
            {
                throw new ArgumentException("Directory must exist.", "directory");
            }

            if (IsRunning)
            {
                throw new InvalidOperationException("RunScannerAsync is already running.");
            }

            var ig = new string[ignoreFiles.Length];

            ignoreFiles.CopyTo(ig, 0);

            ScanFileEventHandler parsed = FileParsed;

            parsed += AudioScannerFileParsed;

            return(new AudioScan(_directory, _searchoption, _parseAdd, _parseUpdate, _removeDeadFiles,
                                 _extensionList.ToArray(), MediaLibrary.Tracks.Select(x => x.Model).ToArray(), ig,
                                 parsed, ScanDone));
        }