Export (0) Print
Expand All

RoleEnvironmentStoppingEventArgs Class

 

Updated: October 18, 2011

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

Namespace:   Microsoft.WindowsAzure.ServiceRuntime
Assembly:  Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)

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

public class RoleEnvironmentStoppingEventArgs : EventArgs

NameDescription
System_CAPS_pubmethodRoleEnvironmentStoppingEventArgs()

Initializes a new instance of the RoleEnvironmentStoppingEventArgs class.

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(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.

Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft