Class SvgVisualContainer
Represents a visual SVG element that can contain other element as children.
Inherited Members
Namespace: OpenSvg.SvgNodes
Assembly: OpenSvg.dll
Syntax
public abstract class SvgVisualContainer : SvgVisual, IXmlSerializable, IEquatable<SvgElement>, ISvgElementContainer
Properties
| Edit this page View SourceChildElements
Gets or sets the child elements of this SvgVisualContainer.
Declaration
public List<SvgElement> ChildElements { get; set; }
Property Value
| Type | Description |
|---|---|
| List<SvgElement> |
Remarks
This property holds a list of child SvgElement instances.
Methods
| Edit this page View SourceAdd(SvgElement)
Adds a SvgElement as a child of this SvgVisualContainer.
Declaration
public void Add(SvgElement svgElement)
Parameters
| Type | Name | Description |
|---|---|---|
| SvgElement | svgElement |
AddAll(IEnumerable<SvgElement>)
Adds a collection of SvgElement as children of this SvgVisualContainer.
Declaration
public void AddAll(IEnumerable<SvgElement> svgElements)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<SvgElement> | svgElements | The collection of SvgElement to add. |
AddChildWithAlignment(SvgVisual, HorizontalAlignment, VerticalAlignment)
Adds an SvgVisual child inside this SvgVisualContainer with specified horizontal and vertical alignment.
Declaration
public void AddChildWithAlignment(SvgVisual child, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment)
Parameters
| Type | Name | Description |
|---|---|---|
| SvgVisual | child | The SvgVisual child to add. |
| HorizontalAlignment | horizontalAlignment | The horizontal alignment for the child, in relation to its new parent. |
| VerticalAlignment | verticalAlignment | The vertical alignment for the child in relation, in relation to its new parent. |
Remarks
Alignment is calculated relative to the bounding boxes of parent and child, when the add is made. Later changes to the bounding boxes of the parent or the child will not trigger a recalculation of the alignment.
Children()
Retrieves the children of this SvgVisualContainer.
Declaration
public IEnumerable<SvgElement> Children()
Returns
| Type | Description |
|---|---|
| IEnumerable<SvgElement> | An enumerable of SvgElement representing the direct children. |
ComputeConvexHull()
Protected method to compute the non-transformed convex hull of this SvgVisual element.
Declaration
protected override ConvexHull ComputeConvexHull()
Returns
| Type | Description |
|---|---|
| ConvexHull |
Overrides
| Edit this page View SourceDescendants()
Retrieves all descendant elements of this SvgVisualContainer.
Declaration
public IEnumerable<SvgElement> Descendants()
Returns
| Type | Description |
|---|---|
| IEnumerable<SvgElement> | An enumerable of SvgElement representing the descendants. |