Esporta (0) Stampa
Espandi tutto

Classe RoleEnvironmentStoppingEventArgs

Represents the arguments for the Stopping event, which occurs when a role instance is being stopped.

Spazio dei nomi: Microsoft.WindowsAzure.ServiceRuntime
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in microsoft.windowsazure.serviceruntime.dll)

'Utilizzo
Dim instance As RoleEnvironmentStoppingEventArgs

public class RoleEnvironmentStoppingEventArgs : EventArgs
public class RoleEnvironmentStoppingEventArgs extends EventArgs
public class RoleEnvironmentStoppingEventArgs extends EventArgs

You typically handle the Stopping event in the OnStart method for the role.

The following code example shows how to 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
}

System.Object
   System.EventArgs
    Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironmentStoppingEventArgs

Tutti i membri statici pubblici (Shared in Visual Basic) di questo tipo sono thread-safe. I membri di istanza non sono garantiti come thread-safe.

Piattaforme di sviluppo

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2008 e Windows 2000

Piattaforme di destinazione

Aggiunte alla community

Mostra:
© 2014 Microsoft