Red Gate forums :: View topic - wp7 and throw new exception for quiting app
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

wp7 and throw new exception for quiting app

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
iosub



Joined: 19 Oct 2010
Posts: 19

PostPosted: Tue Mar 08, 2011 11:00 pm    Post subject: wp7 and throw new exception for quiting app Reply with quote

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!
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 546

PostPosted: Thu Mar 10, 2011 8:40 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group