ExtensionElementCollection.BaseAdd Método
Definição
Adiciona um elemento de configuração ao ExtensionElementCollection.Adds a configuration element to the ExtensionElementCollection.
Sobrecargas
| BaseAdd(ConfigurationElement) |
Adiciona um elemento de configuração ao ExtensionElementCollection.Adds a configuration element to the ExtensionElementCollection. |
| BaseAdd(Int32, ConfigurationElement) |
Adiciona um elemento de configuração ao ExtensionElementCollection no local especificado.Adds a configuration element to the ExtensionElementCollection, at the specified location. |
Comentários
Ao adicionar, um elemento será considerado uma duplicata somente se as chaves forem idênticas, mas os valores forem diferentes.When adding, an element is considered a duplicate only if the keys are identical but the values are different. Elementos com chaves e valores idênticos são aceitos silenciosamente, porque os elementos não competem.Elements with identical keys and values are accepted silently because the elements do not compete. No entanto, um elemento com uma chave idêntica, mas um valor diferente não pode ser adicionado porque não há nenhuma lógica para determinar qual dos valores concorrentes deve ser aceito.However, an element with an identical key but a different value cannot be added because there is no logic to determine which of the competing values should be honored.
BaseAdd(ConfigurationElement)
Adiciona um elemento de configuração ao ExtensionElementCollection.Adds a configuration element to the ExtensionElementCollection.
protected:
override void BaseAdd(System::Configuration::ConfigurationElement ^ element);
protected override void BaseAdd (System.Configuration.ConfigurationElement element);
override this.BaseAdd : System.Configuration.ConfigurationElement -> unit
Protected Overrides Sub BaseAdd (element As ConfigurationElement)
Parâmetros
- element
- ConfigurationElement
O ConfigurationElement a ser adicionado.The ConfigurationElement to add.
Exceções
Uma extensão com o mesmo nome ou tipo que element já existe na coleção.An extension with the same name or type as element already exists in the collection.
Comentários
Ao adicionar, um elemento será considerado uma duplicata somente se as chaves forem idênticas, mas os valores forem diferentes.When adding, an element is considered a duplicate only if the keys are identical but the values are different. Elementos com chaves e valores idênticos são aceitos silenciosamente, porque os elementos não competem.Elements with identical keys and values are accepted silently because the elements do not compete. No entanto, um elemento com uma chave idêntica, mas um valor diferente não pode ser adicionado porque não há nenhuma lógica para determinar qual dos valores concorrentes deve ser aceito.However, an element with an identical key but a different value cannot be added because there is no logic to determine which of the competing values should be honored.
Aplica-se a
BaseAdd(Int32, ConfigurationElement)
Adiciona um elemento de configuração ao ExtensionElementCollection no local especificado.Adds a configuration element to the ExtensionElementCollection, at the specified location.
protected:
override void BaseAdd(int index, System::Configuration::ConfigurationElement ^ element);
protected override void BaseAdd (int index, System.Configuration.ConfigurationElement element);
override this.BaseAdd : int * System.Configuration.ConfigurationElement -> unit
Protected Overrides Sub BaseAdd (index As Integer, element As ConfigurationElement)
Parâmetros
- index
- Int32
A localização do índice na qual adicionar o element.The index location at which to add element.
- element
- ConfigurationElement
O ConfigurationElement a ser adicionado.The ConfigurationElement to add.
Exceções
Uma extensão com o mesmo nome ou tipo que element já existe na coleção.An extension with the same name or type as element already exists in the collection.
Comentários
Ao adicionar, um elemento será considerado uma duplicata somente se as chaves forem idênticas, mas os valores forem diferentes.When adding, an element is considered a duplicate only if the keys are identical but the values are different. Elementos com chaves e valores idênticos são aceitos silenciosamente, porque os elementos não competem.Elements with identical keys and values are accepted silently because the elements do not compete. No entanto, um elemento com uma chave idêntica, mas um valor diferente não pode ser adicionado porque não há nenhuma lógica para determinar qual dos valores concorrentes deve ser aceito.However, an element with an identical key but a different value cannot be added because there is no logic to determine which of the competing values should be honored.