예제 #1
0
 // This is for page.
 public ReadSpec(ReadCounter counter,
                 RCSymbol left,
                 int skipFirst,
                 int totalLimit,
                 bool
                 showDeleted)
 {
     // For paging.
     _counter = counter;
     _forward = totalLimit >= 0;
     _ignoreDispatchedRows = false;
     _start = 0;
     // each symbol is unlimited individually.  But the total is going to be limited by
     // stopAfter.
     _unlimited   = true;
     _symbolLimit = int.MaxValue;
     _skipFirst   = Math.Abs(skipFirst);
     _totalLimit  = Math.Abs(totalLimit);
     ShowDeleted  = showDeleted;
     left         = _counter.ConcreteSymbols(left, showDeleted);
     for (int i = 0; i < left.Count; ++i)
     {
         Add(left[i], 0, _symbolLimit);
     }
 }
예제 #2
0
 public ReadSpec(ReadCounter counter,
                 RCSymbol left,
                 RCLong right,
                 int defaultLimit,
                 bool
                 ignoreDispatchedRows,
                 bool force,
                 bool fill,
                 bool showDeleted)
 {
     _counter              = counter;
     ShowDeleted           = showDeleted;
     _ignoreDispatchedRows = ignoreDispatchedRows;
     _force = force;
     _fill  = fill;
     if (right.Count == 1)
     {
         // It's the start point.
         _forward     = defaultLimit >= 0;
         _unlimited   = defaultLimit == 0;
         _symbolLimit = Math.Abs(_unlimited ? int.MaxValue : defaultLimit);
         left         = _counter.ConcreteSymbols(left, showDeleted);
         for (int i = 0; i < left.Count; ++i)
         {
             Add(left[i], (int)right[0], _symbolLimit);
         }
     }
     else if (right.Count == 2)
     {
         // It's the start point and the limit.
         _forward     = right[1] >= 0;
         _unlimited   = right[1] == 0;
         _symbolLimit = Math.Abs(_unlimited ? int.MaxValue : (int)right[1]);
         left         = _counter.ConcreteSymbols(left, showDeleted);
         for (int i = 0; i < left.Count; ++i)
         {
             Add(left[i], (int)right[0], _symbolLimit);
         }
     }
     else
     {
         // Who knows what this should do.
         // Maybe let you give different counts for each symbol.
         throw new ArgumentException("Read takes a maximum of two right arguments.");
     }
 }