SecurityContext::Run Method (SecurityContext^, ContextCallback^, Object^)
Runs the specified method in the specified security context on the current thread.
Assembly: mscorlib (in mscorlib.dll)
public: [SecurityCriticalAttribute] static void Run( SecurityContext^ securityContext, ContextCallback^ callback, Object^ state )
Parameters
- securityContext
-
Type:
System.Security::SecurityContext^
The security context to set.
- callback
-
Type:
System.Threading::ContextCallback^
The delegate that represents the method to run in the specified security context.
- state
-
Type:
System::Object^
The object to pass to the callback method.
| Exception | Condition |
|---|---|
| InvalidOperationException | securityContext is null. -or- securityContext was not acquired through a capture operation. -or- securityContext has already been used as the argument to a Run method call. |
The security context for the current thread is returned to its previous state when the method call is complete.
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
Available since 2.0