Export (0) Print
Expand All

RoleEnvironmentChangingEventArgs.Changes Property

Updated: January 28, 2013

Gets a collection of the configuration changes that are ready to be applied to the role instance.

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

Public Property Changes As ReadOnlyCollection(Of RoleEnvironmentChange)

Property Value

Type: System.Collections.ObjectModel.ReadOnlyCollection

A ReadOnlyCollection of RoleEnvironmentChange objects.

You can use the values in the Changes property to determine whether the role instance must be recycled. The changes can be of the RoleEnvironmentTopologyChange type or the RoleEnvironmentConfigurationSettingChange type.

The following code example shows how to restart a role instance only when configuration setting values change:

public override bool OnStart()
   RoleEnvironment.Changing += RoleEnvironmentChanging;
   return base.OnStart();

private void RoleEnvironmentChanging(object sender, RoleEnvironmentChangingEventArgs e) 
   // Implements the changes after restarting the role instance
   if ((e.Changes.Any(change is RoleEnvironmentConfigurationSettingChange))) 
      e.Cancel = true;

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows Vista, Windows 7 and Windows Server 2008

Target Platforms

Community Additions

© 2014 Microsoft