Exemple #1
0
 public PageCursor(UsageMap _enclosing)
 {
     this._enclosing    = _enclosing;
     _forwardDirHandler = new UsageMap.PageCursor.ForwardDirHandler(this);
     _reverseDirHandler = new UsageMap.PageCursor.ReverseDirHandler(this);
     this.Reset();
 }
Exemple #2
0
 /// <summary>Gets another page in the given direction, returning the new page.</summary>
 /// <remarks>Gets another page in the given direction, returning the new page.</remarks>
 private int GetAnotherPage(bool moveForward)
 {
     UsageMap.PageCursor.DirHandler handler = this.GetDirHandler(moveForward);
     if (this._curPageNumber == handler.GetEndPageNumber())
     {
         if (!this.IsUpToDate())
         {
             this.RestorePosition(this._prevPageNumber);
         }
         else
         {
             // drop through and retry moving to another page
             // at end, no more
             return(this._curPageNumber);
         }
     }
     this.CheckForModification();
     this._prevPageNumber = this._curPageNumber;
     this._curPageNumber  = handler.GetAnotherPageNumber(this._curPageNumber);
     return(this._curPageNumber);
 }