예제 #1
0
 public ReportSize this[int index]
 {
     get
     {
         if (index < 0 || index >= Count)
         {
             throw new RenderingObjectModelException(ProcessingErrorCode.rsInvalidParameterRange, index, 0, Count);
         }
         ReportSize reportSize = null;
         if (m_reportSizeCollection != null && m_reportSizeCollection[index] != null)
         {
             reportSize = m_reportSizeCollection[index];
         }
         if (reportSize == null)
         {
             Microsoft.ReportingServices.ReportProcessing.Matrix matrix = (Microsoft.ReportingServices.ReportProcessing.Matrix)m_owner.ReportItemDef;
             MatrixInstance       matrixInstance       = (MatrixInstance)m_owner.ReportItemInstance;
             ReportSizeCollection reportSizeCollection = null;
             reportSizeCollection = ((!m_widthsCollection) ? matrix.CellHeightsForRendering : matrix.CellWidthsForRendering);
             Global.Tracer.Assert(reportSizeCollection != null);
             if (m_owner.NoRows || matrixInstance == null || matrixInstance.Cells.Count == 0)
             {
                 reportSize = reportSizeCollection[index];
             }
             else if ((m_widthsCollection && matrix.StaticColumns == null) || (!m_widthsCollection && matrix.StaticRows == null))
             {
                 reportSize = reportSizeCollection[0];
             }
             else
             {
                 bool cacheState = m_owner.RenderingContext.CacheState;
                 m_owner.RenderingContext.CacheState = true;
                 MatrixCellCollection cellCollection = m_owner.CellCollection;
                 MatrixCell           matrixCell     = null;
                 matrixCell = ((!m_widthsCollection) ? cellCollection[index, 0] : cellCollection[0, index]);
                 reportSize = reportSizeCollection[matrixCell.ColumnIndex];
                 m_owner.RenderingContext.CacheState = cacheState;
             }
             if (m_owner.RenderingContext.CacheState)
             {
                 if (m_reportSizeCollection == null)
                 {
                     m_reportSizeCollection = new ReportSizeCollection(Count);
                 }
                 m_reportSizeCollection[index] = reportSize;
             }
         }
         return(reportSize);
     }
 }
 public MatrixCell this[int row, int column]
 {
     get
     {
         if (row < 0 || row >= m_rowsCount)
         {
             throw new RenderingObjectModelException(ProcessingErrorCode.rsInvalidParameterRange, row, 0, m_rowsCount);
         }
         if (column < 0 || column >= m_columnsCount)
         {
             throw new RenderingObjectModelException(ProcessingErrorCode.rsInvalidParameterRange, column, 0, m_columnsCount);
         }
         MatrixCell matrixCell = null;
         if (row == 0 && column == 0)
         {
             matrixCell = m_firstCell;
         }
         else if (row == 0)
         {
             if (m_firstMatrixRowCells != null)
             {
                 matrixCell = m_firstMatrixRowCells[column - 1];
             }
         }
         else if (column == 0)
         {
             if (m_firstMatrixColumnCells != null)
             {
                 matrixCell = m_firstMatrixColumnCells[row - 1];
             }
         }
         else if (m_cells != null && m_cells[row - 1] != null)
         {
             matrixCell = m_cells[row - 1][column - 1];
         }
         if (matrixCell == null)
         {
             matrixCell = new MatrixCell(m_owner, row, column);
             if (m_owner.RenderingContext.CacheState)
             {
                 if (row == 0 && column == 0)
                 {
                     m_firstCell = matrixCell;
                 }
                 else if (row == 0)
                 {
                     if (m_firstMatrixRowCells == null)
                     {
                         m_firstMatrixRowCells = new MatrixRowCells(m_columnsCount - 1);
                     }
                     m_firstMatrixRowCells[column - 1] = matrixCell;
                 }
                 else if (column == 0)
                 {
                     if (m_firstMatrixColumnCells == null)
                     {
                         m_firstMatrixColumnCells = new MatrixRowCells(m_rowsCount - 1);
                     }
                     m_firstMatrixColumnCells[row - 1] = matrixCell;
                 }
                 else
                 {
                     if (m_cells == null)
                     {
                         m_cells = new MatrixRowCells[m_rowsCount - 1];
                     }
                     if (m_cells[row - 1] == null)
                     {
                         m_cells[row - 1] = new MatrixRowCells(m_columnsCount - 1);
                     }
                     m_cells[row - 1][column - 1] = matrixCell;
                 }
             }
         }
         return(matrixCell);
     }
 }