Exemple #1
0
        public long DoGetSearchHitsRFPairList(RootEntry root, int repeatCount, FindOptions findOptions)
        {
            var sw = new Stopwatch();

            sw.Start();
            var rootEntries = new List <RootEntry> {
                root
            };
            var list = new List <PairDirEntry>();

            for (var i = 0; i < repeatCount; i++)
            {
                // var totalFound = 0L;
                findOptions.VisitorFunc = (p, d) =>
                {
                    // ++totalFound;
                    list.Add(new PairDirEntry(p, d));
                    return(true);
                };
                findOptions.Find(rootEntries);
            }

            sw.Stop();
            return(sw.ElapsedMilliseconds);
        }
Exemple #2
0
        //public int TotalFileEntries()
        //{
        //    return _rootEntries.TotalFileEntries();
        //}

        //public IEnumerable<Models.DirEntry> Search(string search)
        public Results <DirEntry> Search(string search, Action <int, int> progress = null)
        {
            var results = ReportLoadMetricOnce();

            var findOptions = new FindOptions
            {
                Pattern          = search,
                RegexMode        = false,
                IncludePath      = true,
                IncludeFiles     = true,
                IncludeFolders   = true,
                LimitResultCount = 25,
                SkipCount        = 0,
                ProgressFunc     = progress,
                ProgressModifier = 5000,
                VisitorFunc      = (p, d) =>
                {
                    results.Value.Add(new DirEntry(p, d));
                    //return list.Count < 25; // dont need to limit count here feature field above for it.
                    return(true);
                },
            };

            results.Start("Find");
            findOptions.Find(_rootEntries);
            results.Stop();
            return(results);
        }
Exemple #3
0
        public long DoGetSearchHitsRFCount(RootEntry root, int repeatCount, FindOptions options)
        {
            var sw = new Stopwatch();

            sw.Start();
            var rootEntries = new List <RootEntry> {
                root
            };

            for (var i = 0; i < repeatCount; i++)
            {
                var totalFound  = 0L;
                var findOptions = new FindOptions
                {
                    Pattern          = "willxxlliw",
                    RegexMode        = false,
                    IncludePath      = false,
                    IncludeFiles     = true,
                    IncludeFolders   = true,
                    LimitResultCount = int.MaxValue,
                    VisitorFunc      = (p, d) =>
                    {
                        ++totalFound;
                        return(true);
                    },
                };
                findOptions.Find(rootEntries);
            }

            sw.Stop();
            return(sw.ElapsedMilliseconds);
        }