internal ExcelWorksheet(string name, ExcelWorksheetCollection parent) { this.defaultColumnWidth = 2340; this.pageBreakViewZoom = 60; this.zoom = 100; this.windowOptions = WorksheetWindowOptions.DefaultGridLineColor | WorksheetWindowOptions.ShowGridLines | WorksheetWindowOptions.ShowOutlineSymbols | WorksheetWindowOptions.ShowSheetHeaders | WorksheetWindowOptions.ShowZeroValues; this.paperSize = 0; this.scalingFactor = 100; this.startPageNumber = 1; this.fitWorksheetWidthToPages = 0; this.fitWorksheetHeightToPages = 0; this.setupOptions = SetupOptions.Portrait; this.printResolution = 0; this.verticalPrintResolution = 0; this.headerMargin = 0.5; this.footerMargin = 0.5; this.numberOfCopies = 1; this.WSBoolOpt = WSBoolOptions.ColGroupRight | WSBoolOptions.RowGroupBelow | WSBoolOptions.ShowAutoBreaks | WSBoolOptions.ShowColumnOutline | WSBoolOptions.ShowRowOutline; this.name = name; this.parent = parent; this.rows = new ExcelRowCollection(this); this.columns = new ExcelColumnCollection(this); this.mergedRanges = new MergedCellRanges(this); this.horizontalPageBreaks = new HorizontalPageBreakCollection(); this.verticalPageBreaks = new VerticalPageBreakCollection(); this.pictures = new ExcelPictureCollection(this); this.shapes = new ExcelShapeCollection(this); this.printOptions = new ExcelPrintOptions(this); this.viewOptions = new ExcelViewOptions(this); }
internal MergedCellRanges(ExcelWorksheet parent, MergedCellRanges sourceRanges) { this.items = new Hashtable(); this.parent = parent; foreach (MergedCellRange range in sourceRanges.Values) { this.Add(new MergedCellRange(this.parent, range)); } }
internal ExcelWorksheet(string name, ExcelWorksheetCollection parent, ExcelWorksheet sourceWorksheet) { this.defaultColumnWidth = 2340; this.pageBreakViewZoom = 60; this.zoom = 100; this.windowOptions = WorksheetWindowOptions.DefaultGridLineColor | WorksheetWindowOptions.ShowGridLines | WorksheetWindowOptions.ShowOutlineSymbols | WorksheetWindowOptions.ShowSheetHeaders | WorksheetWindowOptions.ShowZeroValues; this.paperSize = 0; this.scalingFactor = 100; this.startPageNumber = 1; this.fitWorksheetWidthToPages = 0; this.fitWorksheetHeightToPages = 0; this.setupOptions = SetupOptions.Portrait; this.printResolution = 0; this.verticalPrintResolution = 0; this.headerMargin = 0.5; this.footerMargin = 0.5; this.numberOfCopies = 1; this.WSBoolOpt = WSBoolOptions.ColGroupRight | WSBoolOptions.RowGroupBelow | WSBoolOptions.ShowAutoBreaks | WSBoolOptions.ShowColumnOutline | WSBoolOptions.ShowRowOutline; this.name = name; this.parent = parent; this.protectedWorksheet = sourceWorksheet.protectedWorksheet; this.rows = new ExcelRowCollection(this, sourceWorksheet.rows); this.columns = new ExcelColumnCollection(this, sourceWorksheet.columns); this.defaultColumnWidth = sourceWorksheet.defaultColumnWidth; this.mergedRanges = new MergedCellRanges(this, sourceWorksheet.mergedRanges); this.WSBoolOpt = sourceWorksheet.WSBoolOpt; if (sourceWorksheet.PreservedWorksheetRecords != null) { this.PreservedWorksheetRecords = new PreservedRecords(sourceWorksheet.PreservedWorksheetRecords); } this.windowOptions = sourceWorksheet.windowOptions & ~(WorksheetWindowOptions.SheetSelected | WorksheetWindowOptions.SheetVisible); this.firstVisibleRow = sourceWorksheet.firstVisibleRow; this.firstVisibleColumn = sourceWorksheet.firstVisibleColumn; this.pageBreakViewZoom = sourceWorksheet.pageBreakViewZoom; this.zoom = sourceWorksheet.zoom; this.horizontalPageBreaks = new HorizontalPageBreakCollection(sourceWorksheet.horizontalPageBreaks); this.verticalPageBreaks = new VerticalPageBreakCollection(sourceWorksheet.verticalPageBreaks); this.paperSize = sourceWorksheet.paperSize; this.scalingFactor = sourceWorksheet.scalingFactor; this.startPageNumber = sourceWorksheet.startPageNumber; this.fitWorksheetWidthToPages = sourceWorksheet.fitWorksheetWidthToPages; this.fitWorksheetHeightToPages = sourceWorksheet.fitWorksheetHeightToPages; this.setupOptions = sourceWorksheet.setupOptions; this.printResolution = sourceWorksheet.printResolution; this.verticalPrintResolution = sourceWorksheet.verticalPrintResolution; this.headerMargin = sourceWorksheet.headerMargin; this.footerMargin = sourceWorksheet.footerMargin; this.numberOfCopies = sourceWorksheet.numberOfCopies; this.namedRanges = new NamedRangeCollection(this, sourceWorksheet.NamedRanges); this.pictures = new ExcelPictureCollection(this, sourceWorksheet.Pictures); this.shapes = new ExcelShapeCollection(this, sourceWorksheet.Shapes); this.printOptions = new ExcelPrintOptions(this); this.viewOptions = new ExcelViewOptions(this); }
internal override void FixMergedRegionsIndexes(int index, int offset) { MergedCellRanges mergedRanges = base.Parent.MergedRanges; MergedCellRanges ranges2 = new MergedCellRanges(base.Parent); foreach (MergedCellRange range in mergedRanges.Values) { range.FixRowIndexes(index, offset); if ((range.Height >= 1) && ((range.Height != 1) || (range.Width != 1))) { ranges2.AddInternal(range); } } base.Parent.MergedRanges = ranges2; }