ThreadHelper.ThrowIfNotOnUIThread Method
Determines whether the call is being made on the UI thread, and throws COMException(RPC_E_WRONG_THREAD) if it is not.
Namespace: Microsoft.VisualStudio.Shell
Assembly: Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)
Syntax
'Declaration
Public Shared Sub ThrowIfNotOnUIThread ( _
callerMemberName As String _
)
public static void ThrowIfNotOnUIThread(
string callerMemberName
)
public:
static void ThrowIfNotOnUIThread(
String^ callerMemberName
)
static member ThrowIfNotOnUIThread :
callerMemberName:string -> unit
public static function ThrowIfNotOnUIThread(
callerMemberName : String
)
Parameters
callerMemberName
Type: StringThe optional name of caller if a Debug Assert is desired if not on the UI thread.
Exceptions
Exception | Condition |
---|---|
[COMException] | Thrown with RPC_E_WRONG_THREAD when called on any thread other than the main UI thread. |
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.