SALES: 1-800-867-1380
This topic has not yet been rated - Rate this topic

RoleEnvironmentChangedEventArgs.Changes Property

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)
'Usage

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.