wp7 and throw new exception for quiting app

.NET obfuscator and automated error reporting

Moderators: Luke Jefferson, melvyn.harbour, dom.smith

wp7 and throw new exception for quiting app

Postby iosub » Tue Mar 08, 2011 11:00 pm

HI

I'm using a hack to quit the wp7 SL app if the user cancel the login..

this is the code
namespace MSP.Phone.Exceptions
{
public class Custom
{
public class QuitException : Exception { }

public static void Quit()
{
throw new QuitException();
}
}
}

and on the app.xaml.cs

private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
if (e.ExceptionObject is MSP.Phone.Exceptions.Custom.QuitException)
return;


if (System.Diagnostics.Debugger.IsAttached)
{
// An unhandled exception has occurred; break into the debugger
System.Diagnostics.Debugger.Break();
}
}

my problem is that I have enable SA reporting, so every time the user cancel the login screen, the SA Reporting catch the execption.

Is there a way to cancel the SA reporting in this situation.. Maybe with a attribute??

Unfortunately WP7 does not have a app.quit option so this is the only way to quit the app.

any solution?

thanks!
iosub
 
Posts: 19
Joined: Tue Oct 19, 2010 3:40 pm

Postby Chris.Allen » Thu Mar 10, 2011 8:40 pm

The most recent version of SA catches WPF exceptions and tries whenever possible to let the app *continue* which is what 99% of developers would generally wish to happen.
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm


Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 0 guests