Exporter (0) Imprimer
Développer tout
EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

RoleEnvironment.Changed Event

Updated: December 6, 2013

Occurs after a change to the service configuration is applied to the running instances of a role.

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

public:
static event EventHandler<RoleEnvironmentChangedEventArgs^>^ Changed {
	void add (EventHandler<RoleEnvironmentChangedEventArgs^>^ value);
	void remove (EventHandler<RoleEnvironmentChangedEventArgs^>^ value);
}

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 settings that were changed in the service configuration. You can use the Changing event to decide when the changes are applied.

The following code example shows how to write the list of configuration changes that were made to the role instance when the Changed event is raised:


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) 
   {
      Trace.WriteLine("Setting: " + settingChange.ConfigurationSettingName, "Information");
   }
}

Development Platforms

Windows Vista, Windows 7 and Windows Server 2008

Target Platforms

Ajouts de la communauté

AJOUTER
Microsoft réalise une enquête en ligne pour recueillir votre opinion sur le site Web de MSDN. Si vous choisissez d’y participer, cette enquête en ligne vous sera présentée lorsque vous quitterez le site Web de MSDN.

Si vous souhaitez y participer,
Afficher:
© 2014 Microsoft