Exportera (0) Skriv ut
Visa allt
EN
Det här innehållet finns inte tillgängligt på ditt språk men här finns den engelska versionen,

RoleEnvironmentTopologyChange.RoleName Property

Updated: October 25, 2013

Gets the name of the role for which the topology is changing.

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

public string RoleName { get; }

Property Value

Type: System.String

A String that contains the name of the role for which the topology is changing.

The following code example shows how to retrieve the name of the role for which the topology is changing:


public override bool OnStart() 
{
   RoleEnvironment.Changed += RoleEnvironmentChanged;
 
   return base.OnStart();
}

private void RoleEnvironmentChanged(object sender, RoleEnvironmentChangedEventArgs e)
{
   var changes = e.Changes.OfType<RoleEnvironmentTopologyChange>();
   foreach (var change in changes)
   {
      Trace.WriteLine("The topology was changed for: " + change.RoleName, "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.

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

Target Platforms

Gruppinnehåll

Lägg till
Visa:
© 2014 Microsoft