Export (0) Print
Expand All

RoleEnvironmentChangedEventArgs.Changes Property

Updated: October 18, 2011

Gets a collection of the configuration changes that were applied to a role instance.

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

public ReadOnlyCollection<RoleEnvironmentChange> Changes { get; }

Property Value

Type: System.Collections.ObjectModel.ReadOnlyCollection

A ReadOnlyCollection of RoleEnvironmentChange objects. The changes can be of the RoleEnvironmentTopologyChange type or the RoleEnvironmentConfigurationSettingChange type.

The following code example shows how to retrieve the configuration changes from Changes:


public override bool OnStart()
{
   RoleEnvironment.Changed += RoleEnvironmentChanged;
  
   return base.OnStart();
}

private void RoleEnvironmentChanged(object sender, RoleEnvironmentChangedEventArgs e)
{
   // Get the list of configuration changes
   var settingChanges = e.Changes.OfType<RoleEnvironmentConfigurationSettingChange>();
      
   foreach (var settingChange in settingChanges) 
   {
      var message = "Setting: " + settingChange.ConfigurationSettingName;
      Trace.WriteLine(message, "Information");
   }
}

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

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft