Export (0) Print
Expand All

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)

public ReadOnlyCollection<RoleEnvironmentChange> Changes { get; internal set; }

Property Value

Type: System.Collections.ObjectModel.ReadOnlyCollection<RoleEnvironmentChange>

Type: System.Collections.ObjectModel.ReadOnlyCollection

A ReadOnlyCollection<T> 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");
   }
}
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft