RoleEnvironmentStoppingEventArgs Class
Updated: October 18, 2011
Represents the arguments for the Stopping event, which occurs when a role instance is being stopped.
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)
System.Object
System.EventArgs
Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironmentStoppingEventArgs
System.EventArgs
Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironmentStoppingEventArgs
| Name | Description | |
|---|---|---|
![]() | RoleEnvironmentStoppingEventArgs() | Initializes a new instance of the RoleEnvironmentStoppingEventArgs class. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | (Inherited from Object.) |
![]() | Finalize() | (Inherited from Object.) |
![]() | GetHashCode() | (Inherited from Object.) |
![]() | GetType() | (Inherited from Object.) |
![]() | MemberwiseClone() | (Inherited from Object.) |
![]() | ToString() | (Inherited from Object.) |
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 }
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
.jpeg?cs-save-lang=1&cs-lang=csharp)
.jpeg?cs-save-lang=1&cs-lang=csharp)