ConfigurationElementCollection.BaseAdd 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
파생 클래스에서 재정의될 때 ConfigurationElement를 ConfigurationElementCollection 인스턴스에 추가합니다.
오버로드
| BaseAdd(ConfigurationElement) |
구성 요소를 ConfigurationElementCollection에 추가합니다. |
| BaseAdd(ConfigurationElement, Boolean) |
구성 요소를 구성 요소 컬렉션에 추가합니다. |
| BaseAdd(Int32, ConfigurationElement) |
구성 요소를 구성 요소 컬렉션에 추가합니다. |
설명
메서드를 BaseAdd 사용하여 컬렉션에 새 ConfigurationElement 를 추가합니다. 요소를 추가할 때 사용자 지정 동작이 필요한 경우 파생 클래스에서 재정의합니다.
요소를 추가할 때 키는 동일한데 값이 다른 요소의 경우에만 중복 요소로 간주됩니다. 키와 값이 모두 동일한 요소들은 서로 충돌하지 않으므로 오류 없이 추가할 수 있습니다. 그러나 키는 동일한데 값이 다른 요소의 경우에는 충돌하는 값 중에서 적용할 값을 결정하는 논리가 없으므로 추가할 수 없습니다.
BaseAdd(ConfigurationElement)
구성 요소를 ConfigurationElementCollection에 추가합니다.
protected:
virtual void BaseAdd(System::Configuration::ConfigurationElement ^ element);
protected virtual void BaseAdd (System.Configuration.ConfigurationElement element);
abstract member BaseAdd : System.Configuration.ConfigurationElement -> unit
override this.BaseAdd : System.Configuration.ConfigurationElement -> unit
Protected Overridable Sub BaseAdd (element As ConfigurationElement)
매개 변수
- element
- ConfigurationElement
추가할 ConfigurationElement입니다.
예제
다음 코드 예제에서는 재정의 BaseAdd 하는 방법 및 메서드에서 Add 호출 하는 방법.
public void Add(UrlConfigElement url)
{
BaseAdd(url);
// Your custom code goes here.
}
Public Sub Add(ByVal url As UrlConfigElement)
BaseAdd(url)
' Your custom code goes here.
End Sub
설명
메서드를 BaseAdd 사용하여 컬렉션에 새 ConfigurationElement 를 추가합니다. 요소를 추가할 때 사용자 지정 동작이 필요한 경우 파생 클래스에서 재정의합니다.
요소를 추가할 때 키는 동일한데 값이 다른 요소의 경우에만 중복 요소로 간주됩니다. 키와 값이 모두 동일한 요소들은 서로 충돌하지 않으므로 오류 없이 추가할 수 있습니다. 그러나 키는 동일한데 값이 다른 요소의 경우에는 충돌하는 값 중에서 적용할 값을 결정하는 논리가 없으므로 추가할 수 없습니다.
적용 대상
BaseAdd(ConfigurationElement, Boolean)
구성 요소를 구성 요소 컬렉션에 추가합니다.
protected:
void BaseAdd(System::Configuration::ConfigurationElement ^ element, bool throwIfExists);
protected public:
void BaseAdd(System::Configuration::ConfigurationElement ^ element, bool throwIfExists);
protected void BaseAdd (System.Configuration.ConfigurationElement element, bool throwIfExists);
protected internal void BaseAdd (System.Configuration.ConfigurationElement element, bool throwIfExists);
member this.BaseAdd : System.Configuration.ConfigurationElement * bool -> unit
Protected Sub BaseAdd (element As ConfigurationElement, throwIfExists As Boolean)
Protected Friend Sub BaseAdd (element As ConfigurationElement, throwIfExists As Boolean)
매개 변수
- element
- ConfigurationElement
추가할 ConfigurationElement입니다.
- throwIfExists
- Boolean
지정된 ConfigurationElement가 ConfigurationElementCollection에 포함되어 있는 경우 예외를 throw하려면 true이고, 그렇지 않으면 false입니다.
예외
추가할 ConfigurationElement가 ConfigurationElementCollection에 이미 있고 throwIfExists 매개 변수가 true인 경우
설명
지정된 ConfigurationElement 개체가 컬렉션에 이미 있는 경우 선택적 매개 변수 throwIfExists 를 사용하여 예외를 ConfigurationElementCollection throw Exception 합니다.
요소는 키가 동일하지만 값이 다른 경우에만 중복으로 간주됩니다. 키와 값이 모두 동일한 요소들은 서로 충돌하지 않으므로 오류 없이 추가할 수 있습니다. 그러나 키는 동일한데 값이 다른 요소의 경우에는 충돌하는 값 중에서 적용할 값을 결정하는 논리가 없으므로 추가할 수 없습니다.
적용 대상
BaseAdd(Int32, ConfigurationElement)
구성 요소를 구성 요소 컬렉션에 추가합니다.
protected:
virtual void BaseAdd(int index, System::Configuration::ConfigurationElement ^ element);
protected virtual void BaseAdd (int index, System.Configuration.ConfigurationElement element);
abstract member BaseAdd : int * System.Configuration.ConfigurationElement -> unit
override this.BaseAdd : int * System.Configuration.ConfigurationElement -> unit
Protected Overridable Sub BaseAdd (index As Integer, element As ConfigurationElement)
매개 변수
- index
- Int32
지정된 ConfigurationElement를 추가할 인덱스 위치입니다.
- element
- ConfigurationElement
추가할 ConfigurationElement입니다.
설명
매개 변수를 index 사용하여 특정 인덱스 위치의 ConfigurationElement 에 개체를 추가합니다 ConfigurationElementCollection .