Merge pull request #495 from nicolas-raoul/fix-for-issue2907-with-no-formatting-changes
[mono.git] / mcs / tests / projects / MonoTouch / AppDelegate.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4
5 using MonoTouch.Foundation;
6 using MonoTouch.UIKit;
7 using MonoTouch.NUnit.UI;
8
9 namespace TestMcs
10 {
11         // The UIApplicationDelegate for the application. This class is responsible for launching the 
12         // User Interface of the application, as well as listening (and optionally responding) to 
13         // application events from iOS.
14         [Register ("AppDelegate")]
15         public partial class AppDelegate : UIApplicationDelegate
16         {
17                 // class-level declarations
18                 UIWindow window;
19                 TouchRunner runner;
20
21                 //
22                 // This method is invoked when the application has loaded and is ready to run. In this 
23                 // method you should instantiate the window, load the UI into it and then make the window
24                 // visible.
25                 //
26                 // You have 17 seconds to return from this method, or iOS will terminate your application.
27                 //
28                 public override bool FinishedLaunching (UIApplication app, NSDictionary options)
29                 {
30                         // create a new window instance based on the screen size
31                         window = new UIWindow (UIScreen.MainScreen.Bounds);
32                         runner = new TouchRunner (window);
33
34                         // register every tests included in the main application/assembly
35                         runner.Add (System.Reflection.Assembly.GetExecutingAssembly ());
36
37                         window.RootViewController = new UINavigationController (runner.GetViewController ());
38                         
39                         // make the window visible
40                         window.MakeKeyAndVisible ();
41                         
42                         return true;
43                 }
44         }
45 }
46