ISessionStateItemCollection.Remove(String) Método
Definição
Exclui um item da coleção.Deletes an item from the collection.
public:
void Remove(System::String ^ name);
public void Remove (string name);
abstract member Remove : string -> unit
Public Sub Remove (name As String)
Parâmetros
- name
- String
O nome do item a ser excluído da coleção.The name of the item to delete from the collection.
Exemplos
O exemplo de código a seguir mostra uma implementação do Remove método.The following code example shows an implementation of the Remove method. Para obter um exemplo de uma implementação completa da ISessionStateItemCollection interface, consulte o exemplo fornecido na ISessionStateItemCollection visão geral da interface.For an example of a complete implementation of the ISessionStateItemCollection interface, see the example provided in the ISessionStateItemCollection interface overview.
public void Remove(string name)
{
pItems.Remove(name);
pDirty = true;
}
Public Sub Remove(name As String) Implements ISessionStateItemCollection.Remove
pItems.Remove(name)
pDirty = True
End Sub
Comentários
Ao implementar o Remove método, você deve definir a Dirty propriedade como true para indicar que os valores na ISessionStateItemCollection implementação foram modificados.In implementing the Remove method, you should set the Dirty property to true to indicate values in the ISessionStateItemCollection implementation have been modified.
Se a ISessionStateItemCollection implementação não contiver um elemento com o especificado name , a coleção deverá permanecer inalterada e nenhuma exceção será gerada.If the ISessionStateItemCollection implementation does not contain an element with the specified name, the collection should remain unchanged and no exception be thrown.