This topic has not yet been rated - Rate this topic

RoleEnvironmentChangedEventArgs Class

Represents the arguments for the Changed event, which occurs after a configuration change has been applied to a role instance.

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

public class RoleEnvironmentChangedEventArgs : EventArgs

The Changed event and the Changing event are used together to identify and manage configuration changes to the service model. The RoleEnvironmentChangedEventArgs object provides the changes that were made in the service configuration. The changes can be of the RoleEnvironmentTopologyChange type or the RoleEnvironmentConfigurationSettingChange type.

The following code example shows how to use the RoleEnvironmentChangedEventArgs object to write out the list of configuration changes that were made to the role instance:


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

System.Object
   System.EventArgs
    Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironmentChangedEventArgs
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)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.