RoleEnvironmentChangingEventArgs.Changes Property
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)
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)
/** @property */ /** @attribute CompilerGeneratedAttribute() */ public ReadOnlyCollection<RoleEnvironmentChange> get_Changes ()
CompilerGeneratedAttribute public function get Changes () : ReadOnlyCollection<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 2008Target Platforms