Class SvgAttributeCollection
A collection of Scalable Vector Attributes that can be inherited from the owner elements ancestors.
Implements
Inherited Members
Namespace: Svg
Assembly: Svg.dll
Syntax
public sealed class SvgAttributeCollection : Dictionary<string, object>, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IReadOnlyDictionary<string, object>, IReadOnlyCollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable
Constructors
| Improve this Doc View SourceSvgAttributeCollection(SvgElement)
Initialises a new instance of a SvgAttributeCollection with the given SvgElement as the owner.
Declaration
public SvgAttributeCollection(SvgElement owner)
Parameters
| Type | Name | Description |
|---|---|---|
| SvgElement | owner | The SvgElement owner of the collection. |
Properties
| Improve this Doc View SourceItem[String]
Gets the attribute with the specified name.
Declaration
public object this[string attributeName] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | attributeName | A System.String containing the attribute name. |
Property Value
| Type | Description |
|---|---|
| Object | The attribute value associated with the specified name; If there is no attribute the parent's value will be inherited. |
Methods
| Improve this Doc View SourceGetAttribute<TAttributeType>(String, TAttributeType)
Gets the attribute with the specified name.
Declaration
public TAttributeType GetAttribute<TAttributeType>(string attributeName, TAttributeType defaultValue = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | attributeName | A System.String containing the name of the attribute. |
| TAttributeType | defaultValue | The value to return if a value hasn't already been specified. |
Returns
| Type | Description |
|---|---|
| TAttributeType | The attribute value if available; otherwise the default value of |
Type Parameters
| Name | Description |
|---|---|
| TAttributeType | The type of the attribute value. |
GetInheritedAttribute<TAttributeType>(String, Boolean, TAttributeType)
Gets the attribute with the specified name and inherits from ancestors if there is no attribute set.
Declaration
public TAttributeType GetInheritedAttribute<TAttributeType>(string attributeName, bool inherited, TAttributeType defaultValue = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | attributeName | A System.String containing the name of the attribute. |
| Boolean | inherited | Used only if the attribute value is not available. If set to true, the inherited value is returned in this case, otherwise the default value. |
| TAttributeType | defaultValue | The value to return if a value hasn't already been specified. |
Returns
| Type | Description |
|---|---|
| TAttributeType | The attribute value if available and not set to "inherit"; the ancestors value for the same attribute if it exists and if either the attribute value is set to "inherit", or |
Type Parameters
| Name | Description |
|---|---|
| TAttributeType | The type of the attribute value. |
Events
| Improve this Doc View SourceAttributeChanged
Fired when an Atrribute has changed
Declaration
public event EventHandler<AttributeEventArgs> AttributeChanged
Event Type
| Type | Description |
|---|---|
| System.EventHandler<AttributeEventArgs> |