public static bool CurrentThreadRequiresSecurityContextCapture()
{
// If we know that the thread is not made up of entirely full trust code, and that there are no
// security stack modifiers on the thread, then there is no need to capture a security context.
return(!CodeAccessSecurityEngine.QuickCheckForAllDemands());
}