Exportar (0) Imprimir
Expandir Tudo
Este tópico ainda não foi avaliado como - Avalie este tópico

Evento RoleEnvironment.Stopping

[Este tópico é uma documentação de pré-lançamento e está sujeito a alterações em versões futuras. Os tópicos em branco são incluídos como espaços reservados.]

Occurs when a role instance is about to be stopped.

Namespace: Microsoft.WindowsAzure.ServiceRuntime
Assembly: Microsoft.WindowsAzure.ServiceRuntime (em microsoft.windowsazure.serviceruntime.dll)
'Uso
Dim handler As EventHandler(Of RoleEnvironmentStoppingEventArgs)

AddHandler RoleEnvironment.Stopping, handler

public static event EventHandler<RoleEnvironmentStoppingEventArgs> Stopping
/** @event */
public static void add_Stopping (EventHandler<RoleEnvironmentStoppingEventArgs> value)

/** @event */
public static void remove_Stopping (EventHandler<RoleEnvironmentStoppingEventArgs> value)

The Stopping event is used to run code when a role instance is being stopped. This event is raised after the role instance has been taken out of the rotation of the load balancer, but before the OnStop method is called. You can use this event to run code that is required for a role instance to shut down correctly. The Stopping event is not raised when the virtual machine of the role instance is rebooted.

The following code example shows how you can run code when the role instance is being stopped:


public override bool OnStart()
{
   RoleEnvironment.Stopping += RoleEnvironmentStopping;
  
   return base.OnStart();
} 

private void RoleEnvironmentStopping(object sender, RoleEnvironmentStoppingEventArgs e) 
{
   // Add code that is run when the role instance is being stopped
}

Plataformas de desenvolvimento

Windows XP Professional com Service Pack 2 (SP2)

Plataformas de destino

Isso foi útil para você?
(1500 caracteres restantes)
Agradecemos os seus comentários

Contribuições da comunidade

Mostrar:
© 2014 Microsoft. Todos os direitos reservados.