NamespaceCollection.Remove(String) Método
Definição
Remove o objeto NamespaceInfo com a chave especificada da coleção.Removes the NamespaceInfo object with the specified key from the collection.
public:
void Remove(System::String ^ s);
public void Remove (string s);
member this.Remove : string -> unit
Public Sub Remove (s As String)
Parâmetros
- s
- String
O namespace de um objeto NamespaceInfo a ser removido da coleção.The namespace of a NamespaceInfo object to remove from the collection.
Exceções
Não há nenhum objeto NamespaceInfo com a chave especificada na coleção.There is no NamespaceInfo object with the specified key in the collection.
- ou --or- O elemento já foi removido.The element has already been removed.
- ou --or- A coleção é somente leitura.The collection is read-only.
Exemplos
O exemplo de código a seguir mostra como usar o método Remove.The following code example shows how to use the Remove method. Este exemplo de código faz parte de um exemplo maior fornecido para a PagesSection classe.This code example is part of a larger example provided for the PagesSection class.
// Execute the Remove method.
pagesSection.Namespaces.Remove("System.Collections");
' Execute the Remove method.
pagesSection.Namespaces.Remove("System.Collections")
Comentários
Se o elemento especificado for definido em um arquivo de configuração de nível superior, esse método inserirá um remove elemento na seção apropriada do arquivo de configuração no nível do aplicativo atual.If the specified element is defined in a higher-level configuration file, this method inserts a remove element into the appropriate section of the configuration file at the level of the current application. Se o elemento for definido no arquivo de configuração atual, sua entrada será removida do arquivo de configuração.If the element is defined in the current configuration file, its entry is removed from the configuration file. O objeto a ser removido deve existir na coleção; caso contrário, um ConfigurationException será lançado.The object to remove must exist in the collection; if it does not, a ConfigurationException is thrown.