Click or drag to resize

OpenXmlElementFunctionalExtensionsWithTElement(TElement, Object) Method

Adds child elements or attributes to the given element.

Namespace: DocumentFormat.OpenXml
Assembly: DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll) Version: 2.20.0+Branch.release-v2.20.0.Sha.a873d3fbff9bffe179fea62486da950adf5be65d.a873d3fbff9bffe179fea62486da950adf5be65d
Syntax
public static TElement With<TElement>(
	this TElement element,
	Object content
)
where TElement : OpenXmlElement

Parameters

element  TElement
The element.
content  Object
The content to be added to the element.

Type Parameters

TElement
The element type.

Return Value

TElement
The element with the content added to it.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TElement. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also