Share via


RoleEnvironmentTopologyChange.RoleName Property

 

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)

Syntax

public string RoleName { get; internal set; }
public:
property String^ RoleName {
    String^ get();
    internal: void set(String^ value);
}
member RoleName : string with get, internal set
Public Property RoleName As String
    Get
    Friend Set
End Property

Property Value

Type: System.String

Type: System.String

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

Remarks

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

See Also

RoleEnvironment
RoleEntryPoint
RoleEnvironmentChangedEventArgs
RoleEnvironmentTopologyChange Class
Microsoft.WindowsAzure.ServiceRuntime Namespace

Return to top