Share via


ConfigurationElementCollectionBase<T>.CreateElement Method

Definition

Creates a new child element for the current collection.

Overloads

CreateElement()

Creates a new child element for the current collection.

CreateElement(String)

Creates a new child element by using the specified name.

CreateElement()

Creates a new child element for the current collection.

public:
 T CreateElement();
public T CreateElement ();
member this.CreateElement : unit -> 'T
Public Function CreateElement () As T

Returns

T

A reference to the strongly typed configuration element that was created.

Remarks

This overload creates an element by using the <add> element name defined in the configuration schema. To specify the name of the child item being created, use the CreateElement(String) overload, which takes a string parameter.

Applies to

CreateElement(String)

Creates a new child element by using the specified name.

public:
 T CreateElement(System::String ^ elementTagName);
public T CreateElement (string elementTagName);
member this.CreateElement : string -> 'T
Public Function CreateElement (elementTagName As String) As T

Parameters

elementTagName
String

The name of the element to create

Returns

T

A reference to the strongly typed configuration element that was created.

Remarks

This overload creates an element by using the element name provided in the elementTagName parameter. To use the <add> element name defined in the configuration schema, use the CreateElement() overload, which takes no parameters.

Applies to