locked
suspend and resume

    Question

  • HI,

    I am using visual studio 2012 and I am new to suspend and resume...I created an app but it does not suspend and resume and MS wants it to do so. I am really unclear as to how to do it and the current examples on MSDN use Visual Studio 2013.

    Can anyone help?

    Thanks

    MArlon

    Thursday, July 18, 2013 7:01 PM

Answers

  • If you're running inside Visual Studio, suspend and resume are disabled. Instead, VS has some controls to force these states so you can debug them. If you run outside of the debugger, then suspend and resume will happen automatically.

    If you're new to all this, I highly recommend looking at Chapter 3 of my free ebook below, where you'll find all the details. The VS tooling bit is briefly mentioned in the docs, but it's a little hard to see, so the book chapter shows it much more clearly. That chapter is also very good for overall app anatomy.

    Kraig

    Author, Programming Windows 8 Apps with HTML, CSS, and JavaScript, a free ebook from Microsoft Press
    Also see the Second edition preview for Windows 8.1.


    • Marked as answer by marlon_1_1 Monday, July 22, 2013 11:14 AM
    Thursday, July 18, 2013 7:35 PM

All replies

  • If you're running inside Visual Studio, suspend and resume are disabled. Instead, VS has some controls to force these states so you can debug them. If you run outside of the debugger, then suspend and resume will happen automatically.

    If you're new to all this, I highly recommend looking at Chapter 3 of my free ebook below, where you'll find all the details. The VS tooling bit is briefly mentioned in the docs, but it's a little hard to see, so the book chapter shows it much more clearly. That chapter is also very good for overall app anatomy.

    Kraig

    Author, Programming Windows 8 Apps with HTML, CSS, and JavaScript, a free ebook from Microsoft Press
    Also see the Second edition preview for Windows 8.1.


    • Marked as answer by marlon_1_1 Monday, July 22, 2013 11:14 AM
    Thursday, July 18, 2013 7:35 PM
  • Craig,

    Thanks very much...I am definitely going to download your book too...it looks really informative. Question:

    Do you know what erro code I should use for a no internet connection exception handling error. If the user presses a button to connect to a site but there is not connection then I want to generate an error, but can't seem to figure it out:

     try
                {
                    CnnFin.Navigate(new Uri("http://money.cnn.com/"));
                    CnnFin.Visibility = Visibility.Visible;
                    i1.Visibility = Visibility.Collapsed;
                 
                }
                catch(Exception  e){

               
                      console.writeline(errorcode for no internet connection)
                
                             }

    If you can help me out I would greatly appreciate it...working on a free app

    Marlon

    Monday, July 22, 2013 11:40 AM
  • If you're working in JavaScript you can output whatever error you'd like, as it's just console.log with a string. Your example, though is in C# and unfortunately I don't know the answer for that language. You'd want to ask in the C# forum.
    Monday, July 22, 2013 2:37 PM