Compartilhar via


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)

Syntax

public ReadOnlyCollection<RoleEnvironmentChange> Changes { get; internal set; }
public:
property ReadOnlyCollection<RoleEnvironmentChange^>^ Changes {
    ReadOnlyCollection<RoleEnvironmentChange^>^ get();
    internal: void set(ReadOnlyCollection<RoleEnvironmentChange^>^ value);
}
member Changes : ReadOnlyCollection<RoleEnvironmentChange> with get, internal set
Public Property Changes As ReadOnlyCollection(Of RoleEnvironmentChange)
    Get
    Friend Set
End Property

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.

Remarks

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");
   }
}

See Also

RoleEnvironment
RoleEnvironmentChangedEventArgs Class
Microsoft.WindowsAzure.ServiceRuntime Namespace

Return to top