/// <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); }
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); }
public void SetCategoryLabelsCellRange(CellRangeAddressBase range) { int count = SetVerticalCellRange(dataCategoryLabels, range); series.NumCategories = (short)count; }
public void SetValuesCellRange(CellRangeAddressBase range) { int count = SetVerticalCellRange(dataValues, range); series.NumValues = (short)count; }
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; }
public void SetCategoryLabelsCellRange(CellRangeAddressBase range) { Integer count = SetVerticalCellRange(dataCategoryLabels, range); if (count == null) { return; } series.SetNumCategories((short)(int)count); }
public void SetValuesCellRange(CellRangeAddressBase range) { Integer count = SetVerticalCellRange(dataValues, range); if (count == null) { return; } series.SetNumValues((short)(int)count); }
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; }