HostExecutionContextManager.SetHostExecutionContext Metod

Definition

Anger den aktuella värdkörningskontexten till den angivna värdkörningskontexten.

public:
 virtual System::Object ^ SetHostExecutionContext(System::Threading::HostExecutionContext ^ hostExecutionContext);
public virtual object SetHostExecutionContext(System.Threading.HostExecutionContext hostExecutionContext);
[System.Security.SecurityCritical]
public virtual object SetHostExecutionContext(System.Threading.HostExecutionContext hostExecutionContext);
abstract member SetHostExecutionContext : System.Threading.HostExecutionContext -> obj
override this.SetHostExecutionContext : System.Threading.HostExecutionContext -> obj
[<System.Security.SecurityCritical>]
abstract member SetHostExecutionContext : System.Threading.HostExecutionContext -> obj
override this.SetHostExecutionContext : System.Threading.HostExecutionContext -> obj
Public Overridable Function SetHostExecutionContext (hostExecutionContext As HostExecutionContext) As Object

Parametrar

hostExecutionContext
HostExecutionContext

Som HostExecutionContext ska anges.

Returer

Ett objekt för att HostExecutionContext återställa till dess tidigare tillstånd.

Attribut

Undantag

hostExecutionContext inte förvärvades genom en avbildningsåtgärd.

-eller-

hostExecutionContext har varit argumentet till ett tidigare SetHostExecutionContext(HostExecutionContext) metodanrop.

Kommentarer

Metoden SetHostExecutionContext anger värdkörningskontexten för den aktuella HostExecutionContext. En HostExecutionContext som har använts som argument till ett annat SetHostExecutionContext metodanrop kan inte skickas som parameter för den här metoden. Använd HostExecutionContext.CreateCopy i stället metoden för att skapa en kopia av ett HostExecutionContext objekt och använd sedan kopian för att ange värdkörningskontexten.

Revert Anropa metoden med hjälp av objektet som returneras av den här metoden för att återställa HostExecutionContext till dess tidigare tillstånd.

Gäller för