public void SubsetIsInvalidSubsetTest() { Range containerRange = Range.Parse("$A$1:$K$5"); Range subsetRange = new Range(); Assert.IsFalse(subsetRange.IsSubset(containerRange)); }
public static ChartSerie CreateChartSerie(ExcelChart chart, bool isPivot, Range seriesAddress, Range xSeriesAddress) { ChartSerie result = null ; switch (chart.ChartType) { case ExcelChartType.XYScatter: case ExcelChartType.XYScatterLines: case ExcelChartType.XYScatterLinesNoMarkers: case ExcelChartType.XYScatterSmooth: case ExcelChartType.XYScatterSmoothNoMarkers: result = new ScatterChartSerie(chart, isPivot); break; case ExcelChartType.Pie: case ExcelChartType.Pie3D: case ExcelChartType.PieExploded: case ExcelChartType.PieExploded3D: case ExcelChartType.PieOfPie: case ExcelChartType.Doughnut: case ExcelChartType.DoughnutExploded: case ExcelChartType.BarOfPie: result = new PieChartSerie(chart, isPivot); break; case ExcelChartType.Line: case ExcelChartType.LineMarkers: case ExcelChartType.LineMarkersStacked: case ExcelChartType.LineMarkersStacked100: case ExcelChartType.LineStacked: case ExcelChartType.LineStacked100: result = new LineChartSerie(chart, isPivot); if (chart.ChartType == ExcelChartType.LineMarkers || chart.ChartType == ExcelChartType.LineMarkersStacked || chart.ChartType == ExcelChartType.LineMarkersStacked100) { ((LineChartSerie)result).Marker = ExcelMarkerStyle.Square; } ((LineChartSerie)result).Smooth = ((ExcelLineChart)chart).Smooth; break; default: result = new ChartSerie(chart, isPivot); break; } result.Series = seriesAddress; result.XSeries = xSeriesAddress; return result; }
private static bool SelfCompare(Range r1, Range r2) { return ((r1.EndRow == r2.EndRow) && (r1.EndColumn == r2.EndColumn) && (r1.StartColumn == r2.StartColumn) && (r1.StartRow == r2.StartRow) && (r1.StartRow > 0) && (r1.StartColumn > 0) && (r2.EndRow > 0) && (r1.EndColumn > 0)); }
/// <summary> /// 是否是某个Range的子集或者相等 /// </summary> /// <param name="containerRange"></param> /// <returns></returns> public bool IsSubsetOrEqual(Range containerRange) { bool result = false; if (containerRange != null) { if (this.IsValidRange() && containerRange.IsValidRange()) { result = containerRange.StartRow <= this.StartRow && containerRange.EndRow >= this.EndRow && containerRange.StartColumn <= this.StartColumn && containerRange.EndColumn >= this.EndColumn; } } return result; }
public Table(WorkSheet workSheet, string name, CellAddress beginAddress) : this(workSheet, name, Range.Parse(workSheet, beginAddress.ColumnIndex, beginAddress.RowIndex, beginAddress.ColumnIndex, beginAddress.RowIndex)) { }