 | OpenXmlElementFunctionalExtensionsWithTElement(TElement, Object) Method |
Adds child elements or attributes to the given element.
Namespace: DocumentFormat.OpenXmlAssembly: DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll) Version: 2.20.0+Branch.release-v2.20.0.Sha.a873d3fbff9bffe179fea62486da950adf5be65d.a873d3fbff9bffe179fea62486da950adf5be65d
Syntaxpublic static TElement With<TElement>(
this TElement element,
Object content
)
where TElement : OpenXmlElement
<ExtensionAttribute>
Public Shared Function With(Of TElement As OpenXmlElement) (
element As TElement,
content As Object
) As TElement
public:
[ExtensionAttribute]
generic<typename TElement>
where TElement : OpenXmlElement
static TElement With(
TElement element,
Object^ content
)
[<ExtensionAttribute>]
static member With :
element : 'TElement *
content : Object -> 'TElement when '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
TElementThe 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