ConfigurationElement.GetCollection ConfigurationElement.GetCollection ConfigurationElement.GetCollection ConfigurationElement.GetCollection Method

Definition

Returns all configuration elements that belong to the current configuration element.

Overloads

GetCollection(String, Type) GetCollection(String, Type) GetCollection(String, Type) GetCollection(String, Type)

Returns the configuration element that has the specified name and type and is under the current configuration element.

GetCollection(Type) GetCollection(Type) GetCollection(Type) GetCollection(Type)

Returns the configuration element that has the specified type and is under the current configuration element.

GetCollection(String) GetCollection(String) GetCollection(String) GetCollection(String)

Returns all configuration elements that belong to the current configuration element.

GetCollection() GetCollection() GetCollection() GetCollection()

Returns the default collection for the current configuration element.

GetCollection(String, Type) GetCollection(String, Type) GetCollection(String, Type) GetCollection(String, Type)

Returns the configuration element that has the specified name and type and is under the current configuration element.

public:
 Microsoft::Web::Administration::ConfigurationElement ^ GetCollection(System::String ^ collectionName, Type ^ collectionType);
public Microsoft.Web.Administration.ConfigurationElement GetCollection (string collectionName, Type collectionType);
member this.GetCollection : string * Type -> Microsoft.Web.Administration.ConfigurationElement
Public Function GetCollection (collectionName As String, collectionType As Type) As ConfigurationElement

Parameters

collectionName
String String String String

The name of the element this method should return.

collectionType
Type Type Type Type

The common language runtime (CLR) type of the collection this method should return.

Returns

Exceptions

Remarks

A child element collection that is represented in the ChildElements property differs from a nested element collection that is represented by the return value of the GetCollection method. Both collections contain ConfigurationElement objects. However, you should use the ChildElements property when you query the configuration for unique child elements such as the system.webServer/asp configuration section. You should use the GetCollection method when you query the configuration for collection elements that contain a unique key or a multi-attribute key, such as the system.webServer/sites configuration section

GetCollection(Type) GetCollection(Type) GetCollection(Type) GetCollection(Type)

Returns the configuration element that has the specified type and is under the current configuration element.

public:
 Microsoft::Web::Administration::ConfigurationElement ^ GetCollection(Type ^ collectionType);
public Microsoft.Web.Administration.ConfigurationElement GetCollection (Type collectionType);
member this.GetCollection : Type -> Microsoft.Web.Administration.ConfigurationElement
Public Function GetCollection (collectionType As Type) As ConfigurationElement

Parameters

collectionType
Type Type Type Type

The common language runtime (CLR) type of the collection this method should return.

Returns

Exceptions

Remarks

A child element collection that is represented in the ChildElements property differs from a nested element collection that is represented by the return value of the GetCollection method. Both collections contain ConfigurationElement objects. However, you should use the ChildElements property when you query the configuration for unique child elements such as the system.webServer/asp configuration section. You should use the GetCollection method when you query the configuration for collection elements that contain a unique key or a multi-attribute key, such as the system.webServer/sites configuration section

GetCollection(String) GetCollection(String) GetCollection(String) GetCollection(String)

Returns all configuration elements that belong to the current configuration element.

public:
 Microsoft::Web::Administration::ConfigurationElementCollection ^ GetCollection(System::String ^ collectionName);
public Microsoft.Web.Administration.ConfigurationElementCollection GetCollection (string collectionName);
member this.GetCollection : string -> Microsoft.Web.Administration.ConfigurationElementCollection
Public Function GetCollection (collectionName As String) As ConfigurationElementCollection

Parameters

collectionName
String String String String

The name of the collection this method should return.

Returns

Exceptions

GetCollection() GetCollection() GetCollection() GetCollection()

Returns the default collection for the current configuration element.

public:
 Microsoft::Web::Administration::ConfigurationElementCollection ^ GetCollection();
public Microsoft.Web.Administration.ConfigurationElementCollection GetCollection ();
member this.GetCollection : unit -> Microsoft.Web.Administration.ConfigurationElementCollection
Public Function GetCollection () As ConfigurationElementCollection

Returns

Remarks

A child element collection that is represented in the ChildElements property differs from a nested element collection that is represented by the return value of the GetCollection method. Both collections contain ConfigurationElement objects. However, you should use the ChildElements property when you query the configuration for unique child elements such as the system.webServer/asp configuration section. You should use the GetCollection method when you query the configuration for collection elements that contain a unique key or a multi-attribute key, such as the system.webServer/sites configuration section.

Applies to