Class AbstractShape
Represents a shape anchored in worksheet drawing content.
Inheritance
Inherited Members
Namespace: DRIT.Spreadsheet.Drawing
Assembly: DRIT.Spreadsheet.dll
Syntax
public class AbstractShape : IWorksheetDrawingObject, ISheetDrawingObject, IDrawingObject
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Constructors
AbstractShape()
Initializes a new instance of the AbstractShape class.
Declaration
protected AbstractShape()
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Properties
Action
Gets the click and hover action settings for this shape.
Maps to a:cNvPr/a:hlinkClick and a:cNvPr/a:hlinkHover.
Declaration
public ActionSettings Action { get; }
Property Value
| Type | Description |
|---|---|
| ActionSettings |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Adjustments
Gets the adjustment values.
Declaration
public List<long> Adjustments { get; }
Property Value
| Type | Description |
|---|---|
| List<long> |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
AlternateText
Specifies the alternate text for the shape.
Declaration
public string AlternateText { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
AnchorPosition
Gets the shape's position relative to its anchor.
Declaration
public Position AnchorPosition { get; }
Property Value
| Type | Description |
|---|---|
| Position |
Remarks
It is different if the shape is anchored to a cell.
AnchoredCell
Specifies the cell that the shape is anchored to.
Declaration
public Cell AnchoredCell { get; set; }
Property Value
| Type | Description |
|---|---|
| Cell |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Effects
Gets the shape effects.
Declaration
public Effects Effects { get; }
Property Value
| Type | Description |
|---|---|
| Effects |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Fill
Gets the shape fill.
Declaration
public Fill Fill { get; }
Property Value
| Type | Description |
|---|---|
| Fill |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
FlipH
Gets or sets whether the shape is flipped horizontally.
Declaration
public bool FlipH { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
FlipV
Gets or sets whether the shape is flipped vertically.
Declaration
public bool FlipV { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Hidden
Exposes the hidden associated with AbstractShape.
Declaration
public bool Hidden { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | The hidden returned by the operation. |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
HyperLink
Specifies the hyperlink for the shape.
Declaration
public Hyperlink HyperLink { get; set; }
Property Value
| Type | Description |
|---|---|
| Hyperlink |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Id
Specifies the shape identifier.
Declaration
public int Id { get; }
Property Value
| Type | Description |
|---|---|
| int |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Line
Gets the shape line (border).
Declaration
public Line Line { get; }
Property Value
| Type | Description |
|---|---|
| Line |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
LockText
Gets or sets whether the text is locked.
Declaration
public bool LockText { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Locked
Exposes the locked associated with AbstractShape.
Declaration
public bool Locked { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | The locked returned by the operation. |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Locks
Gets the granular locking flags for this shape, or null
when no granular locks have been set. Maps to a:spLocks.
Use EnableLocks() to create the lock object on first access.
Declaration
public ShapeLocks Locks { get; }
Property Value
| Type | Description |
|---|---|
| ShapeLocks |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Name
Specifies the shape name.
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
OleObject
Gets the OLE object associated with this shape, if any.
Declaration
public OleObject OleObject { get; }
Property Value
| Type | Description |
|---|---|
| OleObject |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
ParentGroup
Specifies the parent group shape.
Declaration
public GroupShape ParentGroup { get; }
Property Value
| Type | Description |
|---|---|
| GroupShape |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
PolygonPoints
Gets the polygon points.
Declaration
public List<PointDoubleUnit> PolygonPoints { get; }
Property Value
| Type | Description |
|---|---|
| List<PointDoubleUnit> |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Position
Gets the shape position.
Declaration
public Position Position { get; }
Property Value
| Type | Description |
|---|---|
| Position |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Positioning
Specifies the anchor positioning properties.
Declaration
public AnchorProperties Positioning { get; set; }
Property Value
| Type | Description |
|---|---|
| AnchorProperties |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
PrintObject
Gets or sets whether the shape is printed.
Declaration
public bool PrintObject { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
RelativePosition
Specifies the relative position.
Declaration
public RelativePosition RelativePosition { get; set; }
Property Value
| Type | Description |
|---|---|
| RelativePosition |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
RotationAngle
Specifies the rotation angle in degrees.
Declaration
public double RotationAngle { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
ShapeType
Specifies the shape type.
Declaration
public ShapeType ShapeType { get; set; }
Property Value
| Type | Description |
|---|---|
| ShapeType |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Sheet
Gets the parent sheet.
Declaration
public Sheet Sheet { get; }
Property Value
| Type | Description |
|---|---|
| Sheet |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Size
Gets the shape size.
Declaration
public Size Size { get; }
Property Value
| Type | Description |
|---|---|
| Size |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Tags
Gets the key-value tag collection for custom data storage on this shape.
Declaration
public TagCollection Tags { get; }
Property Value
| Type | Description |
|---|---|
| TagCollection |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Worksheet
Specifies the parent worksheet.
Declaration
public Worksheet Worksheet { get; }
Property Value
| Type | Description |
|---|---|
| Worksheet |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
ZOrderPosition
Exposes the zorder position associated with AbstractShape.
Declaration
public int ZOrderPosition { get; }
Property Value
| Type | Description |
|---|---|
| int | The zorder position returned by the operation. |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
Methods
EnableLocks()
Gets the locking flags for this shape, creating the ShapeLocks object on first access.
Declaration
public ShapeLocks EnableLocks()
Returns
| Type | Description |
|---|---|
| ShapeLocks |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
SetImage(string)
Sets the image for the shape fill.
Declaration
public virtual AbstractShape SetImage(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | The path to the image file. |
Returns
| Type | Description |
|---|---|
| AbstractShape | The shape instance for method chaining. |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.
WithAdjustments(params long[])
Sets the adjustment values for the shape.
Declaration
public AbstractShape WithAdjustments(params long[] adjustments)
Parameters
| Type | Name | Description |
|---|---|---|
| long[] | adjustments | The adjustment values. |
Returns
| Type | Description |
|---|---|
| AbstractShape | The shape instance for method chaining. |
Remarks
Spreadsheet shapes are owned by a worksheet or chart drawing and commonly use cell-relative anchors. The anchor is not interchangeable with document-story or slide placement.