public bool ScanThisDirectory(ScannableDirectoryInfo sdi) { bool _errorFlag = false; if (sdi.Scanned == true) return false; try { _listOfDirectories.AddRange(sdi.DirectoryInfo .GetDirectories() .Select<DirectoryInfo, ScannableDirectoryInfo>(new Func<DirectoryInfo, ScannableDirectoryInfo>( (di) => { return new ScannableDirectoryInfo(di); } ))); NumberOfFiles += sdi.DirectoryInfo.GetFiles().Count(); } catch (Exception ex) { Trace.TraceWarning(ex.Message); _errorFlag = true; } return !_errorFlag; }
public bool ScanThisDirectory(ScannableDirectoryInfo sdi) { bool _errorFlag = false; if (sdi.Scanned == true) { return(false); } try { _listOfDirectories.AddRange(sdi.DirectoryInfo .GetDirectories() .Select <DirectoryInfo, ScannableDirectoryInfo>(new Func <DirectoryInfo, ScannableDirectoryInfo>( (di) => { return(new ScannableDirectoryInfo(di)); } ))); NumberOfFiles += sdi.DirectoryInfo.GetFiles().Count(); } catch (Exception ex) { Trace.TraceWarning(ex.Message); _errorFlag = true; } return(!_errorFlag); }