SVGBuilderExtensions.AddLine

AddLine<TBuilder>(this TBuilder, OneOf<double, (double, LengthType)>, OneOf<double, (double, LengthType)>, OneOf<double, (double, LengthType)>, OneOf<double, (double, LengthType)>, OneOf<Color, Paint, string>, OneOf<Color, Paint, string>, string, Action<SVGLineElementBuilder>)

Adds a ’line’ element with specified start and end points, and styles to the SVG builder.

public static TBuilder AddLine<TBuilder>(this TBuilder builder, 
    OneOf<double, (double, LengthType)> x1 = null, OneOf<double, (double, LengthType)> y1 = null, 
    OneOf<double, (double, LengthType)> x2 = null, OneOf<double, (double, LengthType)> y2 = null, 
    OneOf<Color, Paint, string> fill = null, OneOf<Color, Paint, string> stroke = null, 
    string id = null, Action<SVGLineElementBuilder> extend = null)
    where TBuilder : ISVGElementBuilder, IShapeElementBuilder
ParameterDescription
TBuilderThe type of the SVG element builder, facilitating fluent API usage.
builderThe SVG builder instance to which the ’line’ element will be added.
x1The x-coordinate of the start point of the line. Can be a double value or a tuple of double and LengthType.
y1The y-coordinate of the start point of the line. Can be a double value or a tuple of double and LengthType.
x2The x-coordinate of the end point of the line. Can be a double value or a tuple of double and LengthType.
y2The y-coordinate of the end point of the line. Can be a double value or a tuple of double and LengthType.
fillThe fill color or paint style for the line. Can be a Color or a Paint enum value or paint server ID. Optional parameter.
strokeThe stroke color or paint style for the line. Can be a Color or a Paint enum value or paint server ID. Optional parameter.
idThe unique identifier for the line element. Optional parameter.
extendAn optional action to further configure the line element builder.

Return Value

The builder instance, allowing for method chaining.

See Also


AddLine<TBuilder>(this TBuilder, Action<SVGLineElementBuilder>)

Adds a ’line’ element configuration to the builder.

public static TBuilder AddLine<TBuilder>(this TBuilder builder, 
    Action<SVGLineElementBuilder> configure)
    where TBuilder : ISVGElementBuilder, IShapeElementBuilder
ParameterDescription
TBuilderThe type of the SVG element builder.
builderThe builder instance.
configureThe configuration action for the ’line’ element.

Return Value

The builder instance for chaining.

See Also