public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            var sqliteFilename = "TodoSQLite.db3";
            string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder
            string libraryPath = Path.Combine (documentsPath, "..", "Library"); // Library folder
            var path = Path.Combine(libraryPath, sqliteFilename);

            // This is where we copy in the prepopulated database
            Console.WriteLine (path);
            if (!File.Exists (path)) {
                File.Copy (sqliteFilename, path);
            }

            var db = new ADODatabase(path);
            Database = new TodoItemDatabase(db);

            return true;
        }
Пример #2
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            var    sqliteFilename = "TodoSQLite.db3";
            string documentsPath  = Environment.GetFolderPath(Environment.SpecialFolder.Personal); // Documents folder
            string libraryPath    = Path.Combine(documentsPath, "..", "Library");                  // Library folder
            var    path           = Path.Combine(libraryPath, sqliteFilename);

            // This is where we copy in the prepopulated database
            Console.WriteLine(path);
            if (!File.Exists(path))
            {
                File.Copy(sqliteFilename, path);
            }


            var db = new ADODatabase(path);

            Database = new TodoItemDatabase(db);


            return(true);
        }