MergeCellsImpl Class
This class contains information about all merged cells in the parent workbook.
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class MergeCellsImpl : CommonObject, IParentApplication, IDisposable, ICloneParent
Constructors
MergeCellsImpl(IApplication, Object)
Sets application and parent fields.
Declaration
public MergeCellsImpl(IApplication application, object parent)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the new instance. |
System.Object | parent | Parent object for the new instance. |
Methods
AddMerge(RangeImpl, ExcelMergeOperation)
Adds new merge to the existing merges.
Declaration
public void AddMerge(RangeImpl range, ExcelMergeOperation operation)
Parameters
Type | Name | Description |
---|---|---|
RangeImpl | range | Range that should be merged. |
ExcelMergeOperation | operation | Operation type - Information on what needs to be done if some of the cells are already merged. |
AddMerge(Int32, Int32, Int32, Int32, ExcelMergeOperation)
Adds new region if it intersects with other regions.
Declaration
public void AddMerge(int RowFrom, int RowTo, int ColFrom, int ColTo, ExcelMergeOperation operation)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | RowFrom | First row to merge. Zero-based. |
System.Int32 | RowTo | Last row to merge. Zero-based. |
System.Int32 | ColFrom | First column to merge. Zero-based. |
System.Int32 | ColTo | Last column to merge. Zero-based. |
ExcelMergeOperation | operation | Operation type - tells what should be done if some of the cells are already merged. |
AddMerges(IDictionary, Int32, Int32)
Adds dictionary with that describes merge region to the collection.
Declaration
public void AddMerges(IDictionary dictMerges, int iRowDelta, int iColumnDelta)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IDictionary | dictMerges | Regions to add, key - top-left cell index, value - bottom-right cell index. |
System.Int32 | iRowDelta | Row delta. |
System.Int32 | iColumnDelta | Column delta. |
Clear()
Clear all merges.
Declaration
public void Clear()
Clone(Object)
Creates a copy of the current object.
Declaration
public object Clone(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent object for the new object. |
Returns
Type | Description |
---|---|
System.Object | A copy of the current object. |
CopyMoveMerges(IRange, IRange, Boolean)
Moves merges from source range into destination.
Declaration
public void CopyMoveMerges(IRange destination, IRange source, bool bIsMove)
Parameters
Type | Name | Description |
---|---|---|
IRange | destination | Destination range. |
IRange | source | Source range. |
System.Boolean | bIsMove | Indicates whether we are moving merges (true) or copying (false). |
DeleteMerge(Rectangle)
Removes merge that contains a specific cell.
Declaration
public void DeleteMerge(Rectangle range)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Rectangle | range | Range of the cells to be removed. |
FindMergedRegion(Rectangle)
Finds merged region for specific cell.
Declaration
[CLSCompliant(false)]
public MergeCellsRecord.MergedRegion FindMergedRegion(Rectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Rectangle | rectangle | Cell range address. |
Returns
Type | Description |
---|---|
Syncfusion.XlsIO.Parser.Biff_Records.MergeCellsRecord.MergedRegion | Merged region that includes specified cell. |
FindMergesToCopyMove(IRange, Boolean)
Finds all merged ranges for specific range.
Declaration
[CLSCompliant(false)]
public List<MergeCellsRecord.MergedRegion> FindMergesToCopyMove(IRange range, bool bIsMove)
Parameters
Type | Name | Description |
---|---|---|
IRange | range | Range to find merges in. |
System.Boolean | bIsMove | Indicates whether delete merges from the collection is needed or not. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Syncfusion.XlsIO.Parser.Biff_Records.MergeCellsRecord.MergedRegion> | Merges list. |
GetLeftTopCell(Rectangle)
Finds left top cell of merged region.
Declaration
public Rectangle GetLeftTopCell(Rectangle rect)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Rectangle | rect | Merged region rectangle. |
Returns
Type | Description |
---|---|
System.Drawing.Rectangle | Left top cell range. |
GetMergedExtendedFormats()
Gets array of custom extended formats that represents custom merged range.
Declaration
public IList<ExtendedFormatImpl> GetMergedExtendedFormats()
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<ExtendedFormatImpl> | Returns array of Merged extended formats. |
InsertColumn(Int32)
Inserts column into collection.
Declaration
public void InsertColumn(int iColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iColumnIndex |
InsertColumn(Int32, Int32)
Inserts column into collection
Declaration
public void InsertColumn(int iColumnIndex, int iColumnCount)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iColumnIndex | Column index to insert. |
System.Int32 | iColumnCount | Number of columns to insert. |
InsertRemoveColumn(Int32, Boolean, Int32)
Removes or inserts one column from merges collection.
Declaration
protected void InsertRemoveColumn(int iColumnIndex, bool isRemove, int iCount)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iColumnIndex | One-based column index to remove. |
System.Boolean | isRemove | Indicates whether to remove or insert rows. |
System.Int32 | iCount | Number of columns to insert or remove. |
InsertRemoveRow(Int32, Boolean, Int32)
Removes or inserts one row from merges collection.
Declaration
protected void InsertRemoveRow(int iRowIndex, bool isRemove, int iRowCount)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iRowIndex | One-based row index to remove or insert. |
System.Boolean | isRemove | Indicates whether to remove or insert rows. |
System.Int32 | iRowCount | Count of row to remove. |
InsertRow(Int32, Int32)
Inserts row to the collection.
Declaration
public void InsertRow(int iRowIndex, int iRowCount)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iRowIndex | Row index to insert. |
System.Int32 | iRowCount | Number of row to insert. |
NormalizeColumn(Int32, IWorkbook)
Ensures that column index is in correct range.
Declaration
[CLSCompliant(false)]
public static int NormalizeColumn(int iColumnIndex, IWorkbook book)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iColumnIndex | Column index to check. |
IWorkbook | book | Workbook where operation is performed. |
Returns
Type | Description |
---|---|
System.Int32 | Column index from the correct range. |
NormalizeRow(Int32, IWorkbook)
Ensures that row index is in correct range.
Declaration
[CLSCompliant(false)]
public static int NormalizeRow(int iRowIndex, IWorkbook book)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iRowIndex | Row index to check. |
IWorkbook | book | Workbook where operation is performed. |
Returns
Type | Description |
---|---|
System.Int32 | Row index from the correct range. |
Parse()
Adds merge regions from the MergeCellsRecord.
Declaration
public void Parse()
RectangleToMergeRegion(Rectangle)
Converts rectangle to merged region.
Declaration
[CLSCompliant(false)]
public MergeCellsRecord.MergedRegion RectangleToMergeRegion(Rectangle rect)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Rectangle | rect | Rectangle to convert. |
Returns
Type | Description |
---|---|
Syncfusion.XlsIO.Parser.Biff_Records.MergeCellsRecord.MergedRegion | Merged region. |
RemoveColumn(Int32)
Removes column from the collection
Declaration
public void RemoveColumn(int iColumnIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iColumnIndex | Column index to remove. |
RemoveColumn(Int32, Int32)
Removes columns from the collection.
Declaration
public void RemoveColumn(int index, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Column index to remove. |
System.Int32 | count | Number of columns to remove |
RemoveRow(Int32)
Removes row from the collection.
Declaration
public void RemoveRow(int iRowIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iRowIndex | Row index to remove. |
RemoveRow(Int32, Int32)
Removes row(s) from the collection.
Declaration
public void RemoveRow(int rowIndex, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | Row index to remove. |
System.Int32 | count | Number of rows to remove. |
SetNewDimensions(Int32, Int32)
Sets new dimensions - removes unnecessary items (that are out of bounds) or truncates them.
Declaration
public void SetNewDimensions(int newRowCount, int newColumnCount)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | newRowCount | New maximum possible row count. |
System.Int32 | newColumnCount | New maximum possible column count. |