public MatrixCellInstance AddCell(ReportProcessing.ProcessingContext pc, out NonComputedUniqueNames cellNonComputedUniqueNames)
        {
            Matrix matrix             = (Matrix)base.m_reportItemDef;
            int    currentCellRIIndex = this.GetCurrentCellRIIndex();
            bool   flag = matrix.ProcessingInnerGrouping == Pivot.ProcessingInnerGroupings.Column;
            int    num;
            int    colIndex;

            if (flag)
            {
                num      = this.m_currentOuterStaticIndex;
                colIndex = this.m_currentInnerStaticIndex;
            }
            else
            {
                colIndex = this.m_currentOuterStaticIndex;
                num      = this.m_currentInnerStaticIndex;
            }
            MatrixCellInstance matrixCellInstance = null;

            matrixCellInstance = ((pc.HeadingInstance == null || pc.HeadingInstance.MatrixHeadingDef.Subtotal.StyleClass == null) ? new MatrixCellInstance(num, colIndex, matrix, currentCellRIIndex, pc, out cellNonComputedUniqueNames) : new MatrixSubtotalCellInstance(num, colIndex, matrix, currentCellRIIndex, pc, out cellNonComputedUniqueNames));
            if (!flag && this.m_currentCellOuterIndex == 0)
            {
                goto IL_009c;
            }
            if (flag && this.m_currentCellInnerIndex == 0)
            {
                goto IL_009c;
            }
            goto IL_0146;
IL_0146:
            if (matrix.ProcessingInnerGrouping == Pivot.ProcessingInnerGroupings.Column)
            {
                this.m_cells[this.m_currentCellOuterIndex].Add(matrixCellInstance);
            }
            else
            {
                if (this.m_currentCellOuterIndex == 0)
                {
                    Global.Tracer.Assert(this.m_cells.Count == this.m_currentCellInnerIndex);
                    MatrixCellInstanceList value = new MatrixCellInstanceList();
                    this.m_cells.Add(value);
                }
                this.m_cells[this.m_currentCellInnerIndex].Add(matrixCellInstance);
            }
            this.m_currentCellInnerIndex++;
            return(matrixCellInstance);

IL_009c:
            if (!pc.Pagination.IgnoreHeight)
            {
                pc.Pagination.AddToCurrentPageHeight(matrix, matrix.MatrixRows[num].HeightValue);
            }
            if (!pc.Pagination.IgnorePageBreak && pc.Pagination.CurrentPageHeight >= pc.Pagination.PageHeight && this.m_rowInstances.Count > 1)
            {
                pc.Pagination.SetCurrentPageHeight(matrix, 0.0);
                this.m_extraPagesFilled++;
                matrix.CurrentPage = this.m_startPage + this.m_extraPagesFilled;
                this.m_numberOfChildrenOnThisPage = 0;
            }
            else
            {
                this.m_numberOfChildrenOnThisPage++;
            }
            goto IL_0146;
        }
 public MatrixCellInstanceInfo(int rowIndex, int colIndex, Matrix matrixDef, int cellDefIndex, ReportProcessing.ProcessingContext pc, MatrixCellInstance owner, out NonComputedUniqueNames nonComputedUniqueNames)
 {
     this.m_rowIndex    = rowIndex;
     this.m_columnIndex = colIndex;
     if (0 < matrixDef.CellReportItems.Count && !matrixDef.CellReportItems.IsReportItemComputed(cellDefIndex))
     {
         this.m_contentUniqueNames = NonComputedUniqueNames.CreateNonComputedUniqueNames(pc, matrixDef.CellReportItems[cellDefIndex]);
     }
     nonComputedUniqueNames = this.m_contentUniqueNames;
     Global.Tracer.Assert(cellDefIndex < matrixDef.FirstCellInstances.Count);
     if (matrixDef.FirstCellInstances[cellDefIndex])
     {
         pc.ChunkManager.AddInstanceToFirstPage(this, owner, pc.InPageSection);
         matrixDef.FirstCellInstances[cellDefIndex] = false;
     }
     else
     {
         pc.ChunkManager.AddInstance(this, owner, pc.InPageSection);
     }
 }
        protected override object SearchChildren(int targetUniqueName, ref NonComputedUniqueNames nonCompNames, ChunkManager.RenderingChunkManager chunkManager)
        {
            object obj    = null;
            Matrix matrix = (Matrix)base.ReportItemDef;

            if (matrix.CornerReportItems.Count > 0)
            {
                if (this.m_cornerContent != null)
                {
                    obj = ((ISearchByUniqueName)this.m_cornerContent).Find(targetUniqueName, ref nonCompNames, chunkManager);
                    if (obj != null)
                    {
                        return(obj);
                    }
                }
                else
                {
                    NonComputedUniqueNames cornerNonComputedNames = ((MatrixInstanceInfo)base.GetInstanceInfo(chunkManager, false)).CornerNonComputedNames;
                    obj = ((ISearchByUniqueName)matrix.CornerReportItems[0]).Find(targetUniqueName, ref cornerNonComputedNames, chunkManager);
                    if (obj != null)
                    {
                        nonCompNames = cornerNonComputedNames;
                        return(obj);
                    }
                }
            }
            obj = ((ISearchByUniqueName)this.m_columnInstances).Find(targetUniqueName, ref nonCompNames, chunkManager);
            if (obj != null)
            {
                return(obj);
            }
            obj = ((ISearchByUniqueName)this.m_rowInstances).Find(targetUniqueName, ref nonCompNames, chunkManager);
            if (obj != null)
            {
                return(obj);
            }
            int count = this.m_cells.Count;

            for (int i = 0; i < count; i++)
            {
                MatrixCellInstanceList matrixCellInstanceList = this.m_cells[i];
                int count2 = matrixCellInstanceList.Count;
                for (int j = 0; j < count2; j++)
                {
                    MatrixCellInstance     matrixCellInstance = matrixCellInstanceList[j];
                    MatrixCellInstanceInfo instanceInfo       = matrixCellInstance.GetInstanceInfo(chunkManager);
                    int index = instanceInfo.RowIndex * matrix.MatrixColumns.Count + instanceInfo.ColumnIndex;
                    if (matrix.CellReportItems.IsReportItemComputed(index))
                    {
                        if (matrixCellInstance.Content != null)
                        {
                            obj = ((ISearchByUniqueName)matrixCellInstance.Content).Find(targetUniqueName, ref nonCompNames, chunkManager);
                            if (obj != null)
                            {
                                return(obj);
                            }
                        }
                    }
                    else
                    {
                        NonComputedUniqueNames contentUniqueNames = instanceInfo.ContentUniqueNames;
                        obj = ((ISearchByUniqueName)matrix.CellReportItems[index]).Find(targetUniqueName, ref contentUniqueNames, chunkManager);
                        if (obj != null)
                        {
                            nonCompNames = contentUniqueNames;
                            return(obj);
                        }
                    }
                }
            }
            return(null);
        }