RoleEnvironmentChangedEventArgs Class

RoleEnvironmentChangedEventArgs Class

 

Updated: October 18, 2011

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)

System.Object
  System.EventArgs
    Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironmentChangedEventArgs

public class RoleEnvironmentChangedEventArgs : EventArgs

NameDescription
System_CAPS_pubpropertyChanges

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

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft