Udostępnij za pośrednictwem


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

Definition

Inserts the specified element immediately before the specified reference element.

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

Type Parameters

T

Parameters

newChild
T

The OpenXmlElement to insert.

referenceChildrefChild
OpenXmlElement

The OpenXmlElement element before which newChild should be added. Must be a child of this element.

Returns

T

The OpenXmlElement that was inserted.

Remarks

Returns null if newChild is null. Inserted as first child if referenceChild is null.

Applies to