GetInheritedAttribute(String, Boolean, TAttributeType) Method

Definition

Namespace Svg
Assembly Svg.Custom.dll

Gets the attribute with the specified name and inherits from ancestors if there is no attribute set.

public TAttributeType GetInheritedAttribute<TAttributeType>(string attributeName, bool inherited, TAttributeType defaultValue = null)

Type parameters

TAttributeType
The type of the attribute value.

Parameters

attributeName
String?

A String? containing the name of the attribute.

inherited
Boolean

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.

defaultValue
{TAttributeType}

The value to return if a value hasn't already been specified.

Returns

{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 inherited is true; the default value otherwise.