Пример #1
0
 public NestedIndexer this[int index] {
     get {
         if (index < 0 || index >= size.width)
         {
             throw new IndexOutOfRangeException("index exceeds specified buffer width.");
         }
         if (cachedIndexers.ContainsKey(index))
         {
             return(cachedIndexers[index]);
         }
         NestedIndexer res = new NestedIndexer(index, this);
         cachedIndexers[index] = res;
         return(res);
     }
 }
Пример #2
0
 public NestedIndexer this[int index] {
     get {
         if (index < 0 || index >= size.width) {
             throw new IndexOutOfRangeException("index exceeds specified buffer width.");
         }
         if (cachedIndexers.ContainsKey(index)) {
             return cachedIndexers[index];
         }
         NestedIndexer res = new NestedIndexer(index, this);
         cachedIndexers[index] = res;
         return res;
     }
 }