public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { Current = this; wormHole = new Wormhole ("group.co.conceptdev.WatchTodo", "messageDir"); var FileManager = new NSFileManager (); var appGroupContainer = FileManager.GetContainerUrl ("group.co.conceptdev.WatchTodo"); var appGroupContainerPath = appGroupContainer.Path; Console.WriteLine ("agcpath: " + appGroupContainerPath); var sqliteFilename = "TodoSQLite.db3"; // App Group storage, shared with Watch Extension var path = Path.Combine(appGroupContainerPath, sqliteFilename); var conn = new SQLiteConnection (path); Database = new TodoItemDatabase(conn); // HACK: temporary population of data if (Database.GetItems ().Count() == 0) { Database.SaveItem (new TodoItem { Name = "buy pineapple" }); Database.SaveItem (new TodoItem { Name = "buy dragon fruit", Done = true }); Database.SaveItem (new TodoItem { Name = "buy honeydew" }); Database.SaveItem (new TodoItem { Name = "buy rockmelon" }); } return true; }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { Current = this; wormHole = new Wormhole("group.co.conceptdev.WatchTodo", "messageDir"); var FileManager = new NSFileManager(); var appGroupContainer = FileManager.GetContainerUrl("group.co.conceptdev.WatchTodo"); var appGroupContainerPath = appGroupContainer.Path; Console.WriteLine("agcpath: " + appGroupContainerPath); var sqliteFilename = "TodoSQLite.db3"; // App Group storage, shared with Watch Extension var path = Path.Combine(appGroupContainerPath, sqliteFilename); var conn = new SQLiteConnection(path); Database = new TodoItemDatabase(conn); // HACK: temporary population of data if (Database.GetItems().Count() == 0) { Database.SaveItem(new TodoItem { Name = "buy pineapple" }); Database.SaveItem(new TodoItem { Name = "buy dragon fruit", Done = true }); Database.SaveItem(new TodoItem { Name = "buy honeydew" }); Database.SaveItem(new TodoItem { Name = "buy rockmelon" }); } return(true); }