संपादित करें

इसके माध्यम से साझा किया गया


HostExecutionContextManager.SetHostExecutionContext Method

Definition

Sets the current host execution context to the specified host execution context.

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

Parameters

hostExecutionContext
HostExecutionContext

The HostExecutionContext to be set.

Returns

An object for restoring the HostExecutionContext to its previous state.

Attributes

Exceptions

hostExecutionContext was not acquired through a capture operation.

-or-

hostExecutionContext has been the argument to a previous SetHostExecutionContext(HostExecutionContext) method call.

Remarks

The SetHostExecutionContext method sets the host execution context for the current HostExecutionContext. A HostExecutionContext that has been used as the argument to another SetHostExecutionContext method call cannot be passed in as the parameter for this method. Instead, use the HostExecutionContext.CreateCopy method to create a copy of a HostExecutionContext object and then use the copy to set the host execution context.

Call the Revert method using the object returned by this method to restore the HostExecutionContext to its previous state.

Applies to