ShapeImpl Class
Class used for Shape Implementation.
Inheritance
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation.Shapes
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public class ShapeImpl : CommonObject, IShape, IParentApplication, IDisposable, ICloneParent, INamedObject
Constructors
ShapeImpl(IApplication, Object)
Initializes new instance of the shape.
Declaration
public ShapeImpl(IApplication application, object parent)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the new shape. |
System.Object | parent | Parent object for the new shape. |
ShapeImpl(IApplication, Object, ShapeImpl)
Initializes new instance of the shape.
Declaration
public ShapeImpl(IApplication application, object parent, ShapeImpl instance)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the new shape. |
System.Object | parent | Parent object for the new shape. |
ShapeImpl | instance | Current object to clone. |
Fields
DEF_BACK_COLOR
Default background color.
Declaration
protected static readonly Color DEF_BACK_COLOR
Field Value
Type |
---|
System.Drawing.Color |
DEF_FORE_COLOR
Default foreground color.
Declaration
protected static readonly Color DEF_FORE_COLOR
Field Value
Type |
---|
System.Drawing.Color |
DEF_FULL_COLUMN_OFFSET
Offset for full column.
Declaration
public const int DEF_FULL_COLUMN_OFFSET = 1024
Field Value
Type |
---|
System.Int32 |
DEF_FULL_ROW_OFFSET
Offset for full row.
Declaration
public const int DEF_FULL_ROW_OFFSET = 256
Field Value
Type |
---|
System.Int32 |
DEF_NOFILLHITTEST_VALUE
Value of NoFillHitTest option.
Declaration
protected const int DEF_NOFILLHITTEST_VALUE = 1048592
Field Value
Type |
---|
System.Int32 |
DEF_SIZETEXTTOFITSHAPE_FALSE_VALUE
Value of SizeTextToFitShape option when it is set to false.
Declaration
protected const int DEF_SIZETEXTTOFITSHAPE_FALSE_VALUE = 524296
Field Value
Type |
---|
System.Int32 |
DEF_SIZETEXTTOFITSHAPE_TRUE_VALUE
Value of SizeTextToFitShape option when it is set to true.
Declaration
protected const int DEF_SIZETEXTTOFITSHAPE_TRUE_VALUE = 655370
Field Value
Type |
---|
System.Int32 |
DEF_TRANSPARENCY_MULL
Represents default transparency mull.
Declaration
public const double DEF_TRANSPARENCY_MULL = 655
Field Value
Type |
---|
System.Double |
DEF_TRANSPARENCY_MULL_100
Represents default transparency mull multiplied by 100.
Declaration
public const double DEF_TRANSPARENCY_MULL_100 = 65500
Field Value
Type |
---|
System.Double |
m_bSupportOptions
Indicates if this shape support shape color-line options.
Declaration
protected bool m_bSupportOptions
Field Value
Type |
---|
System.Boolean |
m_bUpdateLineFill
Indicates is parse or serialize Line fill properties.
Declaration
protected bool m_bUpdateLineFill
Field Value
Type |
---|
System.Boolean |
m_options
Shape's options.
Declaration
[CLSCompliant(false)]
protected MsofbtOPT m_options
Field Value
Type |
---|
Syncfusion.XlsIO.Parser.Biff_Records.MsoDrawing.MsofbtOPT |
m_shape
Shape record.
Declaration
[CLSCompliant(false)]
protected MsofbtSp m_shape
Field Value
Type |
---|
Syncfusion.XlsIO.Parser.Biff_Records.MsoDrawing.MsofbtSp |
m_shapes
Parent shapes collection.
Declaration
protected ShapeCollectionBase m_shapes
Field Value
Type |
---|
Syncfusion.XlsIO.Implementation.Collections.ShapeCollectionBase |
Properties
AlternativeText
Gets or sets alternative text of the shape
Declaration
public virtual string AlternativeText { get; set; }
Property Value
Type |
---|
System.String |
AutoSize
True if the size of the specified object is changed automatically to fit text within its boundaries. Read/write Boolean.
Declaration
public bool AutoSize { get; set; }
Property Value
Type |
---|
System.Boolean |
BottomRow
Bottom row for the shape.
Declaration
public virtual int BottomRow { get; set; }
Property Value
Type |
---|
System.Int32 |
BottomRowOffset
Bottom row offset for the shape.
Declaration
public virtual int BottomRowOffset { get; set; }
Property Value
Type |
---|
System.Int32 |
ClientAnchor
Client anchor. Read-only.
Declaration
[CLSCompliant(false)]
public MsofbtClientAnchor ClientAnchor { get; }
Property Value
Type |
---|
Syncfusion.XlsIO.Parser.Biff_Records.MsoDrawing.MsofbtClientAnchor |
Fill
Represents fill properties. Read-only.
Declaration
public virtual IFill Fill { get; }
Property Value
Type |
---|
IFill |
HasFill
Indicates whether fill item was created. Read-only.
Declaration
public bool HasFill { get; }
Property Value
Type |
---|
System.Boolean |
HasLineFormat
Indicates whether line item was created. Read-only.
Declaration
public bool HasLineFormat { get; }
Property Value
Type |
---|
System.Boolean |
Height
Gets or sets the height of the shape.
Declaration
public virtual int Height { get; set; }
Property Value
Type |
---|
System.Int32 |
HeightDouble
Gets or sets the height of the Shape expressed in decimal units.
Declaration
public double HeightDouble { get; set; }
Property Value
Type |
---|
System.Double |
Hyperlink
Get object that represents the hyperlink for the shape.
Declaration
public IHyperLink Hyperlink { get; }
Property Value
Type |
---|
IHyperLink |
Id
Gets Shape ID.
Declaration
public virtual int Id { get; }
Property Value
Type |
---|
System.Int32 |
ImageRelation
Gets or sets the image relation
Declaration
public Relation ImageRelation { get; set; }
Property Value
Type |
---|
Syncfusion.XlsIO.Implementation.XmlSerialization.Relation |
ImageRelationId
Gets or sets the Image relation id
Declaration
public string ImageRelationId { get; set; }
Property Value
Type |
---|
System.String |
InnerSpRecord
Returns inner sp record. Read-only.
Declaration
[CLSCompliant(false)]
public MsofbtSp InnerSpRecord { get; }
Property Value
Type |
---|
Syncfusion.XlsIO.Parser.Biff_Records.MsoDrawing.MsofbtSp |
Instance
Returns instance value. Read-only.
Declaration
public virtual int Instance { get; }
Property Value
Type |
---|
System.Int32 |
IsMoveWithCell
Gets or set a value indicating whether shape can move with cell
Declaration
public virtual bool IsMoveWithCell { get; set; }
Property Value
Type |
---|
System.Boolean |
IsShapeVisible
Gets or set a value indicating whether shape is visible
Declaration
public bool IsShapeVisible { get; set; }
Property Value
Type |
---|
System.Boolean |
IsShortVersion
Indicates whether it is short version of the shape (without obj and maybe some other properties).
Declaration
public bool IsShortVersion { get; set; }
Property Value
Type |
---|
System.Boolean |
IsSizeWithCell
Gets or sets a value indicating whether shape can size with cell.
Declaration
public virtual bool IsSizeWithCell { get; set; }
Property Value
Type |
---|
System.Boolean |
Left
Gets or set x coordinate of upper left corner of shape.
Declaration
public virtual int Left { get; set; }
Property Value
Type |
---|
System.Int32 |
LeftColumn
Left column for the shape.
Declaration
public virtual int LeftColumn { get; set; }
Property Value
Type |
---|
System.Int32 |
LeftColumnOffset
Left column offset for the shape.
Declaration
public virtual int LeftColumnOffset { get; set; }
Property Value
Type |
---|
System.Int32 |
LeftDouble
Gets or sets the left position of the Shape expressed in decimal units.
Declaration
public double LeftDouble { get; set; }
Property Value
Type |
---|
System.Double |
Line
Represents line format properties. Read-only.
Declaration
public virtual IShapeLineFormat Line { get; }
Property Value
Type |
---|
IShapeLineFormat |
Name
Gets or sets name of the shape.
Declaration
public virtual string Name { get; set; }
Property Value
Type |
---|
System.String |
Obj
OBJ record. Read-only.
Declaration
[CLSCompliant(false)]
public OBJRecord Obj { get; }
Property Value
Type |
---|
Syncfusion.XlsIO.Parser.Biff_Records.OBJRecord |
OldObjId
Gets or sets object id.
Declaration
[CLSCompliant(false)]
public uint OldObjId { get; set; }
Property Value
Type |
---|
System.UInt32 |
OnAction
Gets or sets macro-command that is called when action happens.
Declaration
public string OnAction { get; set; }
Property Value
Type |
---|
System.String |
ParentShapes
Parent shapes collection. Read-only.
Declaration
public ShapeCollectionBase ParentShapes { get; }
Property Value
Type |
---|
Syncfusion.XlsIO.Implementation.Collections.ShapeCollectionBase |
ParentWorkbook
Parent workbook. Read-only.
Declaration
public WorkbookImpl ParentWorkbook { get; }
Property Value
Type |
---|
WorkbookImpl |
Record
Returns internal shapes record. Read-only.
Declaration
[CLSCompliant(false)]
public MsoBase Record { get; }
Property Value
Type |
---|
Syncfusion.XlsIO.Parser.Biff_Records.MsoDrawing.MsoBase |
RightColumn
Right column for the shape.
Declaration
public virtual int RightColumn { get; set; }
Property Value
Type |
---|
System.Int32 |
RightColumnOffset
Right column offset for the shape.
Declaration
public virtual int RightColumnOffset { get; set; }
Property Value
Type |
---|
System.Int32 |
Shadow
Gets the shadow properties.
Declaration
public IShadow Shadow { get; }
Property Value
Type | Description |
---|---|
IShadow | The shadow properties. |
ShapeCount
Returns number of shapes contained by this shape (1 means no sub shapes). Read-only.
Declaration
public int ShapeCount { get; }
Property Value
Type |
---|
System.Int32 |
ShapeId
Gets / sets shape id.
Declaration
public int ShapeId { get; set; }
Property Value
Type |
---|
System.Int32 |
ShapeRecord
Returns internal shape record, creates new one if necessary. Read-only.
Declaration
[CLSCompliant(false)]
public MsofbtSp ShapeRecord { get; }
Property Value
Type |
---|
Syncfusion.XlsIO.Parser.Biff_Records.MsoDrawing.MsofbtSp |
ShapeRotation
Returns or sets the rotation of the shape, in degrees.
Declaration
public virtual int ShapeRotation { get; set; }
Property Value
Type |
---|
System.Int32 |
ShapeType
Gets or sets shape type
Declaration
public ExcelShapeType ShapeType { get; set; }
Property Value
Type |
---|
ExcelShapeType |
TextFrame
Returns a TextFrame object that contains the alignment and anchoring properties for the specified shape. Read-only.
Declaration
public virtual ITextFrame TextFrame { get; }
Property Value
Type |
---|
ITextFrame |
ThreeD
Gets the chart3 D properties.
Declaration
public IThreeDFormat ThreeD { get; }
Property Value
Type | Description |
---|---|
IThreeDFormat | The chart3 D properties. |
Top
Gets or sets the Y coordinate of the shape
Declaration
public virtual int Top { get; set; }
Property Value
Type |
---|
System.Int32 |
TopDouble
Gets or sets the top position of the Shape expressed in decimal units.
Declaration
public double TopDouble { get; set; }
Property Value
Type |
---|
System.Double |
TopRow
Top row for the shape.
Declaration
public virtual int TopRow { get; set; }
Property Value
Type |
---|
System.Int32 |
TopRowOffset
Top row offset for the shape.
Declaration
public virtual int TopRowOffset { get; set; }
Property Value
Type |
---|
System.Int32 |
UpdatePositions
Indicates whether we have to update absolute positions after setting TopRow, BottomRow, LeftColumn, RightColumn.
Declaration
public bool UpdatePositions { get; set; }
Property Value
Type |
---|
System.Boolean |
VmlShape
Indicates whether this is vml shape or not.
Declaration
public bool VmlShape { get; set; }
Property Value
Type |
---|
System.Boolean |
Width
Gets or sets width of the shape.
Declaration
public virtual int Width { get; set; }
Property Value
Type |
---|
System.Int32 |
WidthDouble
Gets or sets the width of the Shape expressed in decimal units.
Declaration
public double WidthDouble { get; set; }
Property Value
Type |
---|
System.Double |
Workbook
Parent workbook. Read-only.
Declaration
public IWorkbook Workbook { get; }
Property Value
Type |
---|
IWorkbook |
Worksheet
Parent worksheet. Read-only.
Declaration
public WorksheetBaseImpl Worksheet { get; }
Property Value
Type |
---|
WorksheetBaseImpl |
XmlDataStream
Gets / sets xml data stream.
Declaration
public Stream XmlDataStream { get; set; }
Property Value
Type |
---|
System.IO.Stream |
XmlTypeStream
Gets or sets xml type stream.
Declaration
public Stream XmlTypeStream { get; set; }
Property Value
Type |
---|
System.IO.Stream |
Methods
AttachEvents()
Raises events.
Declaration
protected void AttachEvents()
CanCopyShapesOnRangeCopy(Rectangle, Rectangle, out Rectangle)
Indicates is can copy current shape.
Declaration
public virtual bool CanCopyShapesOnRangeCopy(Rectangle sourceRec, Rectangle destRec, out Rectangle newPosition)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Rectangle | sourceRec | Represents source range dimension. |
System.Drawing.Rectangle | destRec | Represents destination range dimension. |
System.Drawing.Rectangle | newPosition | Gets new position of shape. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if can copy; otherwise - false. |
CanInsertRowColumn(Int32, Int32, Boolean, Int32)
Checks whether it is possible insert row or column into iIndex.
Declaration
public bool CanInsertRowColumn(int iIndex, int iCount, bool bRow, int iMaxIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iIndex | Index of row or column to insert. |
System.Int32 | iCount | Number of rows or columns to insert. |
System.Boolean | bRow | Indicates whether rows or columns are inserted. |
System.Int32 | iMaxIndex | Maximum possible index. |
Returns
Type | Description |
---|---|
System.Boolean | True if it is possible to insert row or column. |
Clone(Object)
Creates a clone of the current shape.
Declaration
public object Clone(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | New parent for the shape object. |
Returns
Type | Description |
---|---|
System.Object | A copy of the current shape. |
Clone(Object, Dictionary<String, String>, Dictionary<Int32, Int32>, Boolean)
Creates a clone of the current shape and adds it to the parent shapes collection.
Declaration
public virtual IShape Clone(object parent, Dictionary<string, string> hashNewNames, Dictionary<int, int> dicFontIndexes, bool addToCollections)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | New parent for the shape object. |
System.Collections.Generic.Dictionary<System.String, System.String> | hashNewNames | Dictionary with new worksheet names. |
System.Collections.Generic.Dictionary<System.Int32, System.Int32> | dicFontIndexes | Dictionary with new font indexes. |
System.Boolean | addToCollections | Indicates whether we should add created shape into all necessary parent collections. |
Returns
Type | Description |
---|---|
IShape | A copy of the current shape. |
CloneLineFill(ShapeImpl)
Clones line and fill objects.
Declaration
protected void CloneLineFill(ShapeImpl sourceShape)
Parameters
Type | Name | Description |
---|---|---|
ShapeImpl | sourceShape | Shape to be cloned. |
CopyFillOptions(ShapeImpl, IDictionary)
Copy comments options.
Declaration
public void CopyFillOptions(ShapeImpl sourceShape, IDictionary dicFontIndexes)
Parameters
Type | Name | Description |
---|---|---|
ShapeImpl | sourceShape | Represents source shape. |
System.Collections.IDictionary | dicFontIndexes | Represents dictionary with font indexes. |
CopyFrom(ShapeImpl, Dictionary<String, String>, Dictionary<Int32, Int32>)
Copies settings from another shape object.
Declaration
public virtual void CopyFrom(ShapeImpl shape, Dictionary<string, string> hashNewNames, Dictionary<int, int> dicFontIndexes)
Parameters
Type | Name | Description |
---|---|---|
ShapeImpl | shape | Shape to copy settings from. |
System.Collections.Generic.Dictionary<System.String, System.String> | hashNewNames | Dictionary with new worksheet names. |
System.Collections.Generic.Dictionary<System.Int32, System.Int32> | dicFontIndexes | Dictionary with new font indexes. |
CopyMoveShapeOnRangeCopyMove(WorksheetImpl, Rectangle, Boolean)
Copies / moves shape in range copy / move.
Declaration
public virtual ShapeImpl CopyMoveShapeOnRangeCopyMove(WorksheetImpl sheet, Rectangle destRec, bool bIsCopy)
Parameters
Type | Name | Description |
---|---|---|
WorksheetImpl | sheet | Represents destination sheet. |
System.Drawing.Rectangle | destRec | Represents position of . |
System.Boolean | bIsCopy | Indicates is copy. |
Returns
Type | Description |
---|---|
ShapeImpl | Returns copied moved shape. |
CreateDefaultFillLineFormats()
Creates default fill and line formatting options.
Declaration
protected virtual void CreateDefaultFillLineFormats()
CreateDefaultOptions()
Create default shape options.
Declaration
[CLSCompliant(false)]
protected virtual MsofbtOPT CreateDefaultOptions()
Returns
Type | Description |
---|---|
Syncfusion.XlsIO.Parser.Biff_Records.MsoDrawing.MsofbtOPT | Record with option. |
DetachEvents()
Suppress events.
Declaration
protected void DetachEvents()
EvaluateTopLeftPosition()
Evaluates top left position of the shape.
Declaration
public void EvaluateTopLeftPosition()
GenerateDefaultName()
Generates default shape name and sets it.
Declaration
public virtual void GenerateDefaultName()
InsertRowColumn(Int32, Int32, Boolean)
This method should be called after rows or columns were inserted.
Declaration
public void InsertRowColumn(int iIndex, int iCount, bool bRow)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iIndex | Index of row or column to insert. |
System.Int32 | iCount | Number of rows or columns to insert. |
System.Boolean | bRow | Indicates whether rows or columns are inserted. |
OnDelete()
This method is called when removing shapes from the collection.
Declaration
protected virtual void OnDelete()
OnDispose()
Detaches events and disposes current object.
Declaration
protected override void OnDispose()
Overrides
OnPrepareForSerialization()
This method is called inside of PrepareForSerialization to make shape-dependent preparations.
Declaration
protected virtual void OnPrepareForSerialization()
PrepareForSerialization()
Prepares shape for serialization. We should fill all not prepared fields like m_shape in this method.
Declaration
public void PrepareForSerialization()
RegisterInSubCollection()
Registers shape in all required sub collections.
Declaration
public virtual void RegisterInSubCollection()
Remove()
Removes this shape from the collection.
Declaration
public void Remove()
RemoveRowColumn(Int32, Int32, Boolean)
Removes row or column.
Declaration
public void RemoveRowColumn(int iIndex, int iCount, bool bRow)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iIndex | Index of row or column to remove. |
System.Int32 | iCount | Number of rows or columns to remove. |
System.Boolean | bRow | Indicates whether rows or columns are removed. |
Scale(Int32, Int32)
Scales the shape.
Declaration
public void Scale(int scaleWidth, int scaleHeight)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | scaleWidth | Width scale in percent. |
System.Int32 | scaleHeight | Height scale in percent. |
SetName(String)
Sets shape name without updating parent shapes collection.
Declaration
public void SetName(string strShapeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | strShapeName | Name to set. |
SetParents()
Searches for all necessary parent objects.
Declaration
protected virtual void SetParents()
UpdateBottomRow()
Updates bottom row of the shape.
Declaration
protected void UpdateBottomRow()
UpdateFormula(Int32, Int32, Rectangle, Int32, Rectangle)
Updates formulas after copy operation.
Declaration
public virtual void UpdateFormula(int iCurIndex, int iSourceIndex, Rectangle sourceRect, int iDestIndex, Rectangle destRect)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iCurIndex | Current worksheet index. |
System.Int32 | iSourceIndex | Source worksheet index. |
System.Drawing.Rectangle | sourceRect | Source rectangle. |
System.Int32 | iDestIndex | Destination worksheet index. |
System.Drawing.Rectangle | destRect | Destination rectangle. |
UpdateHeight()
Updates Height of the shape.
Declaration
protected void UpdateHeight()
UpdateNamedRangeIndexes(IDictionary<Int32, Int32>)
Updates indexes to named ranges.
Declaration
public void UpdateNamedRangeIndexes(IDictionary<int, int> dicNewIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.Int32, System.Int32> | dicNewIndex | New indexes. |
UpdateNamedRangeIndexes(Int32[])
Updates indexes to named ranges.
Declaration
public void UpdateNamedRangeIndexes(int[] arrNewIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | arrNewIndex | New indexes. |
UpdateNotSizeNotMoveShape(Boolean, Int32, Int32)
Updates shape that include not size and not move flags.
Declaration
protected virtual void UpdateNotSizeNotMoveShape(bool bRow, int iIndex, int iCount)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bRow | Indicates is row or column to update. |
System.Int32 | iIndex | Row or column index. |
System.Int32 | iCount | Number of inserted/removed rows/column. |
UpdateRightColumn()
Updates right column and offset values correspondingly to left column or offset or width changes.
Declaration
protected void UpdateRightColumn()
UpdateRightColumn(Int32)
Update right column
Declaration
protected void UpdateRightColumn(int iCount)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | iCount |
UpdateWidth()
Updates width of the shape.
Declaration
protected void UpdateWidth()