ThreadHelper.ThrowIfOnUIThread Method (String)

 

Determines whether the call is being made on the UI thread ,and throws COMException(RPC_E_WRONG_THREAD) if it is.

Namespace:   Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)

public static void ThrowIfOnUIThread(
	string callerMemberName = ""
)

Parameters

callerMemberName
Type: System.String

The optional name of caller if a Debug Assert is desired if on the UI thread.

Exception Condition
COMException

Thrown with RPC_E_WRONG_THREAD when called on any thread other than the main UI thread.

Return to top
Show: