internal static void Fail(String conditionString, String message, String windowTitle, int exitCode, StackTrace.TraceFormat stackTraceFormat, int numStackFramesToSkip)
{
// get the stacktrace
StackTrace st = new StackTrace(numStackFramesToSkip, true);
AssertFilters iResult = Filter.AssertFailure(conditionString, message, st, stackTraceFormat, windowTitle);
if (iResult == AssertFilters.FailDebug)
{
if (Debugger.IsAttached == true)
{
Debugger.Break();
}
else
{
if (Debugger.Launch() == false)
{
throw new InvalidOperationException(
Environment.GetResourceString("InvalidOperation_DebuggerLaunchFailed"));
}
}
}
else if (iResult == AssertFilters.FailTerminate)
{
// We want to exit the Silverlight application, after displaying a message.
// Our best known way to emulate this is to exit the process with a known
// error code. Jolt may not be prepared for an appdomain to be unloaded.
Environment._Exit(exitCode);
}
}