Beispiel #1
0
 /// <summary>
 /// Determines whether or not this CellRangeAddress and the specified CellRangeAddress intersect.
 /// </summary>
 /// <param name="other">a candidate cell range address to check for intersection with this range</param>
 /// <returns>returns true if this range and other range have at least 1 cell in common</returns>
 public bool Intersects(CellRangeAddressBase other)
 {
     return(this._firstRow <= other._lastRow &&
            this._firstCol <= other._lastCol &&
            other._firstRow <= this._lastRow &&
            other._firstCol <= this._lastCol);
 }
Beispiel #2
0
 public override bool Equals(Object other)
 {
     if (other is CellRangeAddressBase)
     {
         CellRangeAddressBase o = (CellRangeAddressBase)other;
         return((MinRow == o.MinRow) &&
                (MaxRow == o.MaxRow) &&
                (MinColumn == o.MinColumn) &&
                (MaxColumn == o.MaxColumn));
     }
     return(false);
 }
Beispiel #3
0
            public void SetCategoryLabelsCellRange(CellRangeAddressBase range)
            {
                int count = SetVerticalCellRange(dataCategoryLabels, range);

                series.NumCategories = (short)count;
            }
Beispiel #4
0
            public void SetValuesCellRange(CellRangeAddressBase range)
            {
                int count = SetVerticalCellRange(dataValues, range);

                series.NumValues = (short)count;
            }
Beispiel #5
0
            private int SetVerticalCellRange(BRAIRecord linkedDataRecord,
                                                 CellRangeAddressBase range)
            {
                if (linkedDataRecord == null)
                {
                    throw new ArgumentNullException("linkedDataRecord should not be null"); ;
                }

                List<Ptg> ptgList = new List<Ptg>();

                int rowCount = (range.LastRow - range.FirstRow) + 1;
                int colCount = (range.LastColumn - range.FirstColumn) + 1;

                foreach (Ptg ptg in linkedDataRecord.FormulaOfLink)
                {
                    if (ptg is AreaPtgBase)
                    {
                        AreaPtgBase areaPtg = (AreaPtgBase)ptg;

                        areaPtg.FirstRow = range.FirstRow;
                        areaPtg.LastRow = range.LastRow;

                        areaPtg.FirstColumn = range.FirstColumn;
                        areaPtg.LastColumn = range.LastColumn;
                        ptgList.Add(areaPtg);
                    }
                }

                linkedDataRecord.FormulaOfLink = (ptgList.ToArray());

                return rowCount * colCount;
            }
Beispiel #6
0
		public void SetCategoryLabelsCellRange(CellRangeAddressBase range) {
			Integer count = SetVerticalCellRange(dataCategoryLabels, range);
			if (count == null)
			{
				return;
			}
			
			series.SetNumCategories((short)(int)count);
		}
Beispiel #7
0
		public void SetValuesCellRange(CellRangeAddressBase range) {
			Integer count = SetVerticalCellRange(dataValues, range);
			if (count == null)
			{
				return;
			}
			
			series.SetNumValues((short)(int)count);
		}
Beispiel #8
0
		private Integer SetVerticalCellRange(LinkedDataRecord linkedDataRecord,
				                             CellRangeAddressBase range) {
			if (linkedDataRecord == null)
			{
				return null;
			}
			
			List<Ptg> ptgList = new ArrayList<Ptg>();
			
			int rowCount = (range.GetLastRow() - range.GetFirstRow()) + 1;
			int colCount = (range.GetLastColumn() - range.GetFirstColumn()) + 1;
			
			for (Ptg ptg : linkedDataRecord.GetFormulaOfLink()) {
				if (ptg is AreaPtgBase) {
					AreaPtgBase areaPtg = (AreaPtgBase) ptg;
					
					areaPtg.SetFirstRow(range.GetFirstRow());
					areaPtg.SetLastRow(range.GetLastRow());
					
					areaPtg.SetFirstColumn(range.GetFirstColumn());
					areaPtg.SetLastColumn(range.GetLastColumn());
					ptgList.Add(areaPtg);
				}
			}
			
			linkedDataRecord.SetFormulaOfLink(ptgList.ToArray(new Ptg[ptgList.Size()]));
			
			return rowCount * colCount;
		}