匯出 (0) 列印
全部展開

RoleEnvironmentStoppingEventArgs 類別

Represents the arguments for the Stopping event, which occurs when a role instance is being stopped.

命名空間: Microsoft.WindowsAzure.ServiceRuntime
組件: Microsoft.WindowsAzure.ServiceRuntime (在 microsoft.windowsazure.serviceruntime.dll 中)

'用途
Dim instance As RoleEnvironmentStoppingEventArgs

public class RoleEnvironmentStoppingEventArgs : EventArgs
public class RoleEnvironmentStoppingEventArgs extends EventArgs
public class RoleEnvironmentStoppingEventArgs extends EventArgs

You typically handle the Stopping event in the OnStart method for the role.

The following code example shows how to run code when the role instance is being stopped:


public override bool OnStart()
{
   RoleEnvironment.Stopping += RoleEnvironmentStopping;
  
   return base.OnStart();
}    
   
private void RoleEnvironmentStopping(object sender, RoleEnvironmentStoppingEventArgs e) 
{
   // Add code that is run when the role instance is being stopped
}

System.Object
   System.EventArgs
    Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironmentStoppingEventArgs

任何這個類型的公用靜態 (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。 並非所有的執行個體成員都是安全執行緒。

開發平台

Windows XP Home Edition, Windows XP Professional, Windows Server 2003、Windows Server 2008 和 Windows 2000

目標平台

社群新增項目

顯示:
© 2014 Microsoft