ConfigurationElementCollection.BaseGet Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the ConfigurationElement at the specified index location.
Overloads
BaseGet(Int32) |
Gets the configuration element at the specified index location. |
BaseGet(Object) |
Returns the configuration element with the specified key. |
BaseGet(Int32)
Gets the configuration element at the specified index location.
protected:
System::Configuration::ConfigurationElement ^ BaseGet(int index);
protected public:
System::Configuration::ConfigurationElement ^ BaseGet(int index);
protected System.Configuration.ConfigurationElement BaseGet (int index);
protected internal System.Configuration.ConfigurationElement BaseGet (int index);
member this.BaseGet : int -> System.Configuration.ConfigurationElement
Protected Function BaseGet (index As Integer) As ConfigurationElement
Protected Friend Function BaseGet (index As Integer) As ConfigurationElement
Parameters
- index
- Int32
The index location of the ConfigurationElement to return.
Returns
The ConfigurationElement at the specified index.
Exceptions
Examples
The following code example shows how to call the BaseGet method.
public UrlConfigElement this[int index]
{
get
{
return (UrlConfigElement)BaseGet(index);
}
set
{
if (BaseGet(index) != null)
{
BaseRemoveAt(index);
}
BaseAdd(index, value);
}
}
Default Public Shadows Property Item(ByVal index As Integer) As UrlConfigElement
Get
Return CType(BaseGet(index), UrlConfigElement)
End Get
Set(ByVal value As UrlConfigElement)
If BaseGet(index) IsNot Nothing Then
BaseRemoveAt(index)
End If
BaseAdd(value)
End Set
End Property
Applies to
BaseGet(Object)
Returns the configuration element with the specified key.
protected:
System::Configuration::ConfigurationElement ^ BaseGet(System::Object ^ key);
protected public:
System::Configuration::ConfigurationElement ^ BaseGet(System::Object ^ key);
protected System.Configuration.ConfigurationElement BaseGet (object key);
protected internal System.Configuration.ConfigurationElement BaseGet (object key);
member this.BaseGet : obj -> System.Configuration.ConfigurationElement
Protected Function BaseGet (key As Object) As ConfigurationElement
Protected Friend Function BaseGet (key As Object) As ConfigurationElement
Parameters
- key
- Object
The key of the element to return.
Returns
The ConfigurationElement with the specified key; otherwise, null
.
Examples
The following code example shows how to call the BaseGet method.
new public UrlConfigElement this[string Name]
{
get
{
return (UrlConfigElement)BaseGet(Name);
}
}
Default Public Shadows ReadOnly Property Item(ByVal Name As String) As UrlConfigElement
Get
Return CType(BaseGet(Name), UrlConfigElement)
End Get
End Property
Remarks
The BaseGet method returns null
if there is no ConfigurationElement object with the specified key in the collection.
Applies to
Обратная связь
https://aka.ms/ContentUserFeedback.
Ожидается в ближайшее время: в течение 2024 года мы постепенно откажемся от GitHub Issues как механизма обратной связи для контента и заменим его новой системой обратной связи. Дополнительные сведения см. в разделеОтправить и просмотреть отзыв по