Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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);
        }