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 | |
---|---|---|
Changes | Gets a collection of the configuration changes that were applied to a role instance. |
Methods
Name | Description | |
---|---|---|
Equals(Object) | (Inherited from Object.) |
|
Finalize() | (Inherited from Object.) |
|
GetHashCode() | (Inherited from Object.) |
|
GetType() | (Inherited from Object.) |
|
MemberwiseClone() | (Inherited from Object.) |
|
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