Beispiel #1
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Current = this;

            // create a new window instance based on the screen size
            window = new UIWindow((CGRect)UIScreen.MainScreen.Bounds);

            // make the window visible
            window.MakeKeyAndVisible();

            // create our nav controller
            navController = new UINavigationController();

            // create our home controller based on the device
//			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
            homeViewController = new Tasky.Screens.iPhone.Home.PhoneHomeScreen();
//			} else {
//				homeViewController = new Hello_UniversalViewController ("Hello_UniversalViewController_iPad", null);
//			}

            // Styling
            UINavigationBar.Appearance.TintColor = UIColor.FromRGB(38, 117, 255);              // nice blue
            UITextAttributes ta = new UITextAttributes();

            ta.Font = UIFont.FromName("AmericanTypewriter-Bold", (nfloat)0f);
            UINavigationBar.Appearance.SetTitleTextAttributes(ta);
            ta.Font = UIFont.FromName("AmericanTypewriter", (nfloat)0f);
            UIBarButtonItem.Appearance.SetTitleTextAttributes(ta, UIControlState.Normal);


            var sqliteFilename = "TaskDB.xml";
            // we need to put in /Library/ on iOS5.1 to meet Apple's iCloud terms
            // (they don't want non-user-generated data in Documents)
            string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); // Documents folder
            string libraryPath   = Path.Combine(documentsPath, "../Library/");                    // Library folder
            var    path          = Path.Combine(libraryPath, sqliteFilename);

            var xmlStorage = new XmlStorage();

            TaskMgr = new TaskManager(path, xmlStorage);


            // push the view controller onto the nav controller and show the window
            navController.PushViewController(homeViewController, false);
            window.RootViewController = navController;
            window.MakeKeyAndVisible();

            return(true);
        }
Beispiel #2
0
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			Current = this;

			// create a new window instance based on the screen size
			window = new UIWindow ((CGRect)UIScreen.MainScreen.Bounds);
			
			// make the window visible
			window.MakeKeyAndVisible ();
			
			// create our nav controller
			navController = new UINavigationController ();

			// create our home controller based on the device
//			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
				homeViewController = new Tasky.Screens.iPhone.Home.PhoneHomeScreen();
//			} else {
//				homeViewController = new Hello_UniversalViewController ("Hello_UniversalViewController_iPad", null);
//			}
			
			// Styling
			UINavigationBar.Appearance.TintColor = UIColor.FromRGB (38, 117 ,255); // nice blue
			UITextAttributes ta = new UITextAttributes();
			ta.Font = UIFont.FromName ("AmericanTypewriter-Bold", (nfloat)0f);
			UINavigationBar.Appearance.SetTitleTextAttributes(ta);
			ta.Font = UIFont.FromName ("AmericanTypewriter", (nfloat)0f);
			UIBarButtonItem.Appearance.SetTitleTextAttributes(ta, UIControlState.Normal);
			

			var sqliteFilename = "TaskDB.xml";
			// we need to put in /Library/ on iOS5.1 to meet Apple's iCloud terms
			// (they don't want non-user-generated data in Documents)
			string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder
			string libraryPath = Path.Combine (documentsPath, "../Library/"); // Library folder
            var path = Path.Combine(libraryPath, sqliteFilename);
            
			var xmlStorage = new XmlStorage ();
			TaskMgr = new TaskManager(path, xmlStorage);


			// push the view controller onto the nav controller and show the window
			navController.PushViewController(homeViewController, false);
			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			
			return true;
		}