Dieser Artikel wurde noch nicht bewertet - Dieses Thema bewerten.

RoleEnvironmentConfigurationSettingChange-Klasse

Represents a change to the configuration of a role.

Namespace: Microsoft.WindowsAzure.ServiceRuntime
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in microsoft.windowsazure.serviceruntime.dll)
'Usage
Dim instance As RoleEnvironmentConfigurationSettingChange

public class RoleEnvironmentConfigurationSettingChange : RoleEnvironmentChange, IEquatable<RoleEnvironmentConfigurationSettingChange>
public class RoleEnvironmentConfigurationSettingChange extends RoleEnvironmentChange implements IEquatable<RoleEnvironmentConfigurationSettingChange>
public class RoleEnvironmentConfigurationSettingChange extends RoleEnvironmentChange implements IEquatable<RoleEnvironmentConfigurationSettingChange>

When you make a change to the configuration of a role and apply the changes to role instances, the changes are contained in RoleEnvironmentConfigurationSettingChange objects. The RoleEnvironmentConfigurationSettingChange objects only contain configuration changes that were made to role that corresponds to the currently running role instance.

For more information about defining the service model for a hosted service, see Setting Up a Hosted Service for Windows Azure.

The following code example shows how to use the RoleEnvironmentConfigurationSettingChange object to write out the changes:


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
   Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironmentChange
    Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironmentConfigurationSettingChange
Alle öffentlichen statischen (freigegebenen in Visual Basic) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Entwicklungsplattformen

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2008 und Windows 2000

Zielplattformen

Fanden Sie dies hilfreich?
(1500 verbleibende Zeichen)

Community-Beiträge

© 2013 Microsoft. Alle Rechte vorbehalten.
facebook page visit twitter rss feed newsletter