OpenXmlCompositeElement.ReplaceChild<T>(OpenXmlElement, T) Method

Definition

Replaces one of the current element's child elements with another OpenXmlElement element.

public override T ReplaceChild<T> (DocumentFormat.OpenXml.OpenXmlElement newChild, T oldChild) where T : DocumentFormat.OpenXml.OpenXmlElement;
public override T? ReplaceChild<T> (DocumentFormat.OpenXml.OpenXmlElement newChild, T? oldChild) where T : DocumentFormat.OpenXml.OpenXmlElement;
override this.ReplaceChild : DocumentFormat.OpenXml.OpenXmlElement * 'T -> 'T (requires 'T :> DocumentFormat.OpenXml.OpenXmlElement)
Public Overrides Function ReplaceChild(Of T As OpenXmlElement) (newChild As OpenXmlElement, oldChild As T) As T

Type Parameters

T

Parameters

newChild
OpenXmlElement

The new OpenXmlElement to put in the child list.

oldChild
T

The OpenXmlElement to be replaced in the child list. Must be a child of the current element.

Returns

T

The OpenXmlElement that was replaced.

Remarks

Returns null if newChild equals null.

Applies to