Example #1
0
        public void Add(FoundPage page)
        {
#if DEBUG
            if ((page.FirstKey.Options == SliceOptions.BeforeAllKeys) && (page.LastKey.Options == SliceOptions.AfterAllKeys))
            {
                Debug.Assert(page.CursorPath.Length == 1);
            }
#endif

            int itemsLeft = _cacheSize;
            int position  = current + _cacheSize;
            while (itemsLeft > 0)
            {
                var item = _cache[position % _cacheSize];
                if (item == null || item.Number == page.Number)
                {
                    _cache[position % _cacheSize] = page;
                    return;
                }

                itemsLeft--;
                position--;
            }

            current         = (++current) % _cacheSize;
            _cache[current] = page;
        }
Example #2
0
        public void SearchTextTest()
        {
            var Wiki = new WikiHomePage();

            Wiki.GoToUrl();
            FoundPage Found = Wiki.SearchTheText("Bug");

            Found.AssertIsOpen(); //checking for text h1 "Баг"
        }
 public FoundFormPresenter(IFoundModel model)
 {
     _model         = model;
     instance       = FoundPage.instance;
     PickPicCommand = new Command(() => PickPic());
     SaveCommand    = new Command(() => Save());
     OcrCommand     = new Command(() => OCR());
     CancelCommand  = new Command(() => LoginOpen());
 }
Example #4
0
        public void Add(FoundPage page)
        {
            int itemsLeft = _cacheSize;
            int position = current + _cacheSize;
            while (itemsLeft > 0)
            {
                var itemIndex = position % _cacheSize;
                var item = _cache[itemIndex];
                if (item == null || item.Number == page.Number)
                {
                    _cache[itemIndex] = page;
                    return;
                }

                itemsLeft--;
                position--;
            }

            current = (++current) % _cacheSize;
            _cache[current] = page;
        }
Example #5
0
        public void Add(FoundPage page)
        {
            int itemsLeft = _cacheSize;
            int position  = current + _cacheSize;

            while (itemsLeft > 0)
            {
                var itemIndex = position % _cacheSize;
                var item      = _cache[itemIndex];
                if (item == null || item.Number == page.Number)
                {
                    _cache[itemIndex] = page;
                    return;
                }

                itemsLeft--;
                position--;
            }

            current         = (++current) % _cacheSize;
            _cache[current] = page;
        }
        public void Add(FoundPage page)
        {
#if DEBUG
            if ((page.FirstKey.Options == SliceOptions.BeforeAllKeys) && (page.LastKey.Options == SliceOptions.AfterAllKeys))
            {
                Debug.Assert(page.CursorPath.Length == 1);
            }
#endif

            for (int i = 0; i < _cacheSize; i++)
            {
                if (_cache[i] == null || _cache[i].Number == page.Number)
                {
                    _cache[0] = page;
                    return;
                }
            }

            for (int i = 1; i < _cacheSize; i++)
            {
                _cache[i] = _cache[i - 1];
            }
            _cache[0] = page;
        }
Example #7
0
        public void Add(FoundPage page)
        {
#if DEBUG
            if ((page.FirstKey.Options == SliceOptions.BeforeAllKeys) && (page.LastKey.Options == SliceOptions.AfterAllKeys))
            {
                Debug.Assert(page.CursorPath.Length == 1);
            }
#endif

            for (int i = 0; i < _cacheSize; i++)
            {
                if (_cache[i] == null || _cache[i].Number == page.Number)
                {
                    _cache[0] = page;
                    return;
                }
            }

            for (int i = 1; i < _cacheSize; i++)
            {
                _cache[i] = _cache[i - 1];
            }
            _cache[0] = page;
        }