Class ShapeCollection
Represents a ShapeCollection.
Inherited Members
Namespace: DRIT.Document.Drawing
Assembly: DRIT.Document.dll
Syntax
public class ShapeCollection : IEnumerable<AbstractShape>, IEnumerable
Fields
duplicateShapesByName
Gets duplicate shapes by name.
Declaration
protected Dictionary<string, List<AbstractShape>> duplicateShapesByName
Field Value
| Type | Description |
|---|---|
| Dictionary<string, List<AbstractShape>> |
shapesById
Describes the shape Collection configuration.
Declaration
protected Dictionary<int, AbstractShape> shapesById
Field Value
| Type | Description |
|---|---|
| Dictionary<int, AbstractShape> |
shapesByName
Describes the shape Collection configuration.
Declaration
protected Dictionary<string, AbstractShape> shapesByName
Field Value
| Type | Description |
|---|---|
| Dictionary<string, AbstractShape> |
Properties
Count
Gets count.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
this[int]
Gets this[int].
Declaration
public AbstractShape this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index |
Property Value
| Type | Description |
|---|---|
| AbstractShape |
Methods
AddLine(Position, Size, string)
Provides the add Line behavior for this object.
Declaration
public Shape AddLine(Position position, Size size, string name = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Position | position | The position used by the operation. |
| Size | size | The size used by the operation. |
| string | name | The name of the item. |
Returns
| Type | Description |
|---|---|
| Shape | The resulting value. |
AddLine(double, double, double, double, MeasurementUnit, string)
Provides the add Line behavior for this object.
Declaration
public Shape AddLine(double x, double y, double width, double height, MeasurementUnit unit, string name = null)
Parameters
| Type | Name | Description |
|---|---|---|
| double | x | The x used by the operation. |
| double | y | The y used by the operation. |
| double | width | The width used by the operation. |
| double | height | The height used by the operation. |
| MeasurementUnit | unit | The unit used by the operation. |
| string | name | The name of the item. |
Returns
| Type | Description |
|---|---|
| Shape | The resulting value. |
AddShape(ShapeType, Position, Size, string)
Provides the add Shape behavior for this object.
Declaration
public Shape AddShape(ShapeType shapeType, Position position, Size size, string name = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ShapeType | shapeType | The shape Type used by the operation. |
| Position | position | The position used by the operation. |
| Size | size | The size used by the operation. |
| string | name | The name of the item. |
Returns
| Type | Description |
|---|---|
| Shape | The resulting value. |
AddShape(ShapeType, double, double, double, double, MeasurementUnit, string)
Provides the add Shape behavior for this object.
Declaration
public Shape AddShape(ShapeType shapeType, double x, double y, double width, double height, MeasurementUnit unit, string name = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ShapeType | shapeType | The shape Type used by the operation. |
| double | x | The x used by the operation. |
| double | y | The y used by the operation. |
| double | width | The width used by the operation. |
| double | height | The height used by the operation. |
| MeasurementUnit | unit | The unit used by the operation. |
| string | name | The name of the item. |
Returns
| Type | Description |
|---|---|
| Shape | The resulting value. |
GetConnector(int)
Returns the requested connector.
Declaration
public ConnectorShape GetConnector(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The id used by the operation. |
Returns
| Type | Description |
|---|---|
| ConnectorShape | The resulting value. |
GetConnector(string)
Returns the requested connector.
Declaration
public ConnectorShape GetConnector(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the item. |
Returns
| Type | Description |
|---|---|
| ConnectorShape | The resulting value. |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<AbstractShape> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<AbstractShape> | The resulting value. |
GetGroupShape(string)
Returns the requested group Shape.
Declaration
public GroupShape GetGroupShape(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the item. |
Returns
| Type | Description |
|---|---|
| GroupShape | The resulting value. |
GetPicture(string)
Returns the requested picture.
Declaration
public PictureShape GetPicture(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the item. |
Returns
| Type | Description |
|---|---|
| PictureShape | The resulting value. |
GetShape(string)
Returns the requested shape.
Declaration
public Shape GetShape(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the item. |
Returns
| Type | Description |
|---|---|
| Shape | The resulting value. |
GetTextBox(string)
Returns the requested text Box.
Declaration
public TextBoxShape GetTextBox(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the item. |
Returns
| Type | Description |
|---|---|
| TextBoxShape | The resulting value. |
OnRemove(AbstractShape)
Describes the shape Collection configuration.
Declaration
protected virtual void OnRemove(AbstractShape shape)
Parameters
| Type | Name | Description |
|---|---|---|
| AbstractShape | shape | The shape used by the operation. |
Remove(AbstractShape)
Remove the specified Shape.
Declaration
public void Remove(AbstractShape shape)
Parameters
| Type | Name | Description |
|---|---|---|
| AbstractShape | shape |
RemoveById(int)
Remove the shape with the specified id.
Declaration
public void RemoveById(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id |
RemoveByName(string)
Remove the shape with the specified name.
Declaration
public void RemoveByName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name |
RemoveWhere(Func<AbstractShape, bool>)
Provides the remove Where behavior for this object.
Declaration
public void RemoveWhere(Func<AbstractShape, bool> predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<AbstractShape, bool> | predicate | The predicate used by the operation. |
TryGetById(int, out AbstractShape)
Attempts to get By Id and reports whether the operation succeeded.
Declaration
public bool TryGetById(int id, out AbstractShape shape)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The id used by the operation. |
| AbstractShape | shape | The shape used by the operation. |
Returns
| Type | Description |
|---|---|
| bool | The resulting value. |
TryGetByName(string, out AbstractShape)
Attempts to get By Name and reports whether the operation succeeded.
Declaration
public bool TryGetByName(string name, out AbstractShape shape)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the item. |
| AbstractShape | shape | The shape used by the operation. |
Returns
| Type | Description |
|---|---|
| bool | The resulting value. |