private bool ScrollUntil(SomethingToScrollTo check, FailureToScrollHandler handler, ScrollAction action, ScrollPercentCheck percentCheck) { while (!check(this) && percentCheck()) { action(); } if (!check(this)) { handler(this); } return !check(this); }
private bool ScrollUntil(SomethingToScrollTo check, FailureToScrollHandler handler, ScrollAction action, ScrollPercentCheck percentCheck) { while (!check(this) && percentCheck()) { action(); } if (!check(this)) { handler(this); } return(!check(this)); }
public bool ScrollUp(SomethingToScrollTo check, FailureToScrollHandler handler) { return ScrollUntil(check, handler, _scrollPattern.ScrollUp, () => _scrollPattern.ScrollPercentDown() > 0); }
public bool ScrollLeft(SomethingToScrollTo check, FailureToScrollHandler handler) { return ScrollUntil(check, handler, _scrollPattern.ScrollLeft, () => _scrollPattern.ScrollPercentLeft() < 100); }
public bool ScrollRight(SomethingToScrollTo check, FailureToScrollHandler handler) { return(ScrollUntil(check, handler, _scrollPattern.ScrollRight, () => _scrollPattern.ScrollPercentLeft() > 0)); }
public bool ScrollDown(SomethingToScrollTo check, FailureToScrollHandler handler) { return(ScrollUntil(check, handler, _scrollPattern.ScrollDown, () => _scrollPattern.ScrollPercentDown() < 100)); }