Compartilhar via


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)

Inheritance Hierarchy

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

Syntax

public class RoleEnvironmentChangedEventArgs : EventArgs
public ref class RoleEnvironmentChangedEventArgs : EventArgs
type RoleEnvironmentChangedEventArgs = 
    class
        inherit EventArgs
    end
Public Class RoleEnvironmentChangedEventArgs
    Inherits EventArgs

Properties

Name Description
System_CAPS_pubproperty Changes

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

Methods

Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Remarks

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

Thread Safety

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

See Also

RoleEnvironment
Microsoft.WindowsAzure.ServiceRuntime Namespace

Return to top