示例#1
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            Current = this;

            // TODO: pick which storage library you wish to use...

            // LIST
//			TaskMgr = new TodoItemManager();

            // XML
//			var sqliteFilename = "TodoList.xml";
//			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 XmlStorageImplementation ();
//			TaskMgr = new TodoItemManager(path, xmlStorage);

            // ADO.NET
            var    sqliteFilename = "TodoADODB.db3";
            string documentsPath  = Environment.GetFolderPath(Environment.SpecialFolder.Personal); // Documents folder
            string libraryPath    = Path.Combine(documentsPath, "..", "Library");                  // Library folder
            var    path           = Path.Combine(libraryPath, sqliteFilename);
            var    db             = new ADODatabase(path);

            TaskMgr = new TodoItemManager(db);

            // SQLite
            //var sqliteFilename = "TodoSQLiteDB.db3";
            //string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder
            //string libraryPath = Path.Combine (documentsPath, "..", "Library"); // Library folder
            //var path = Path.Combine(libraryPath, sqliteFilename);
            //var conn = new Connection(path);
            //TaskMgr = new TodoItemManager(conn);


            return(true);
        }
		public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
		{
			Current = this;

            // TODO: pick which storage library you wish to use...

			// LIST
//			TaskMgr = new TodoItemManager();

			// XML
//			var sqliteFilename = "TodoList.xml";
//			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 XmlStorageImplementation ();
//			TaskMgr = new TodoItemManager(path, xmlStorage);

            // ADO.NET
            var sqliteFilename = "TodoADODB.db3";
            string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); // Documents folder
            string libraryPath = Path.Combine(documentsPath, "..", "Library"); // Library folder
            var path = Path.Combine(libraryPath, sqliteFilename);
            var db = new ADODatabase(path);
            TaskMgr = new TodoItemManager(db);

			// SQLite
            //var sqliteFilename = "TodoSQLiteDB.db3";
            //string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder
            //string libraryPath = Path.Combine (documentsPath, "..", "Library"); // Library folder
            //var path = Path.Combine(libraryPath, sqliteFilename);
            //var conn = new Connection(path);
            //TaskMgr = new TodoItemManager(conn);


			return true;
		}