ProfilePropertySettingsCollection.Remove(String) Método
Definição
Remove um objeto ProfilePropertySettings da coleção.Removes a ProfilePropertySettings object from the collection.
public:
void Remove(System::String ^ name);
public void Remove (string name);
member this.Remove : string -> unit
Public Sub Remove (name As String)
Parâmetros
- name
- String
O nome de um objeto ProfilePropertySettings a ser removido da coleção.The name of a ProfilePropertySettings object to remove from the collection.
Exceções
Não há nenhum objeto ProfilePropertySettings com a chave especificada na coleção.There is no ProfilePropertySettings 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 ProfileSection classe.This code example is part of a larger example provided for the ProfileSection class.
// Remove a PropertySettings from the group.
newPropGroup.PropertySettings.Remove("AvatarImage");
newPropGroup.PropertySettings.RemoveAt(0);
' Remove a PropertySettings from the group.
newPropGroup.PropertySettings.Remove("AvatarImage")
newPropGroup.PropertySettings.RemoveAt(0)
Comentários
Esse método insere um remove elemento na seção apropriada do arquivo de configuração para qualquer elemento definido em um arquivo de configuração de nível superior.This method inserts a remove element into the appropriate section of the configuration file for any element defined in a higher-level configuration file. Se o elemento for definido na seção apropriada do arquivo de configuração atual, sua entrada será removida do arquivo de configuração.If the element is defined in the appropriate section of the current configuration file, its entry is removed from the configuration file. O objeto a ser removido deve existir na coleção.The object to remove must exist in the collection.