Пример #1
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // Prevent screen lock
            app.IdleTimerDisabled = true;

            // Load settings
            var conn = NSUserDefaults.StandardUserDefaults.StringForKey("connType");
            var connType = conn == null ? ConnectionType.Registrar : (ConnectionType) Enum.Parse(typeof(ConnectionType), conn);
            var connString = NSUserDefaults.StandardUserDefaults.StringForKey("connString");

            // Init config controller
            var webController = new iOSWebViewController(connType, connString);

            // init the root controller
            var rootController = new UINavigationController();
            rootController.NavigationBarHidden = true;
            rootController.PushViewController(webController, false);

            // init the window, add the root controller
            window = new UIWindow(UIScreen.MainScreen.Bounds);
            window.RootViewController = rootController;
            window.MakeKeyAndVisible();

            return true;
        }