예제 #1
0
        public void TestMethod1()
        {
            var source = new int[5, 5];
            var mp     = new MyEnumerator <int>(source);

            bool result;

            for (int i = 0; i < 25; i++)
            {
                result = mp.MoveNext();
                Assert.IsTrue(result);
            }

            result = mp.MoveNext();
            Assert.IsFalse(result);

            mp.Reset();
            result = mp.MoveNext();
            Assert.IsTrue(result);
        }
예제 #2
0
        /** Serializes the cells that are allocated to a certain row range*/
        public int SerializeCellRow(int row, int offset, byte[] data)
        {
            MyEnumerator itr = new MyEnumerator(ref records, row, row);
            int          pos = offset;

            while (itr.MoveNext())
            {
                CellValueRecordInterface cell = (CellValueRecordInterface)itr.Current;
                if (cell.Row != row)
                {
                    break;
                }
                pos += ((RecordBase)cell).Serialize(pos, data);
            }
            return(pos - offset);
        }
예제 #3
0
        /** Tallies a count of the size of the cell records
         *  that are attached to the rows in the range specified.
         */
        public int GetRowCellBlockSize(int startRow, int endRow)
        {
            MyEnumerator itr  = new MyEnumerator(ref records, startRow, endRow);
            int          size = 0;

            while (itr.MoveNext())
            {
                CellValueRecordInterface cell = (CellValueRecordInterface)itr.Current;
                int row = cell.Row;
                if (row > endRow)
                {
                    break;
                }
                if ((row >= startRow) && (row <= endRow))
                {
                    size += ((RecordBase)cell).RecordSize;
                }
            }
            return(size);
        }
예제 #4
0
        /** Serializes the cells that are allocated to a certain row range*/
        public int SerializeCellRow(int row, int offset, byte[] data)
        {
            MyEnumerator itr = new MyEnumerator(ref records,row, row);
            int pos = offset;

            while (itr.MoveNext())
            {
                CellValueRecordInterface cell = (CellValueRecordInterface)itr.Current;
                if (cell.Row != row)
                    break;
                pos += ((RecordBase)cell).Serialize(pos, data);
            }
            return pos - offset;
        }
예제 #5
0
 /** Tallies a count of the size of the cell records
  *  that are attached to the rows in the range specified.
  */
 public int GetRowCellBlockSize(int startRow, int endRow)
 {
     MyEnumerator itr = new MyEnumerator(ref records,startRow, endRow);
     int size = 0;
     while (itr.MoveNext())
     {
         CellValueRecordInterface cell = (CellValueRecordInterface)itr.Current;
         int row = cell.Row;
         if (row > endRow)
             break;
         if ((row >= startRow) && (row <= endRow))
             size += ((RecordBase)cell).RecordSize;
     }
     return size;
 }
 public bool MoveNext()
 {
     return(_enumerator.MoveNext());
 }
 bool IEnumerator.MoveNext()
 {
     return(MyEnumerator.MoveNext());
 }