Skip to content

Commit f7d79e3

Browse files
Moving skip to jump from expermental into the main branch...
1 parent 25075eb commit f7d79e3

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

AlphaChiTech.Virtualization/PaginationManager.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,14 @@ protected void CalculateFromIndex(int index, out int page, out int inneroffset)
484484

485485
}
486486

487+
private int _StepToJumpThreashold = 10;
488+
489+
public int StepToJumpThreashold
490+
{
491+
get { return _StepToJumpThreashold; }
492+
set { _StepToJumpThreashold = value; }
493+
}
494+
487495
private void DoStepBackwards(ref int page, ref int offset, int stepAmount)
488496
{
489497
bool done = false;
@@ -492,8 +500,7 @@ private void DoStepBackwards(ref int page, ref int offset, int stepAmount)
492500
while(!done)
493501
{
494502

495-
#if EXPEREMENTAL
496-
if(stepAmount>this.PageSize * 10 && ignoreSteps<=0)
503+
if (stepAmount > this.PageSize * StepToJumpThreashold && ignoreSteps <= 0)
497504
{
498505
int targetPage = page - stepAmount/this.PageSize;
499506
int sourcePage = page;
@@ -523,7 +530,6 @@ private void DoStepBackwards(ref int page, ref int offset, int stepAmount)
523530
ignoreSteps = sourcePage - adj.Last().Page;
524531
}
525532
}
526-
#endif
527533

528534
if (!done)
529535
{
@@ -556,8 +562,7 @@ private void DoStepForward(ref int page, ref int offset, int stepAmount)
556562
while(!done)
557563
{
558564

559-
#if EXPEREMENTAL
560-
if (stepAmount > this.PageSize * 10 && ignoreSteps<=0)
565+
if (stepAmount > this.PageSize * StepToJumpThreashold && ignoreSteps <= 0)
561566
{
562567
int targetPage = page + stepAmount / this.PageSize;
563568
int sourcePage = page;
@@ -587,7 +592,6 @@ private void DoStepForward(ref int page, ref int offset, int stepAmount)
587592
ignoreSteps = adj.Last().Page - sourcePage;
588593
}
589594
}
590-
#endif
591595

592596
if (!done)
593597
{

0 commit comments

Comments
 (0)