//private int backgroundTaskId; public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { FavoriteLocations = new FavoritesDbManager(FavoritesDbManager.DatabaseFilePath); UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); UINavigationBar.Appearance.ShadowImage = new UIImage(); UINavigationBar.Appearance.BackgroundColor = UIColor.Clear; UINavigationBar.Appearance.TintColor = UIColor.White; UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false); DurationToSendLocation_Sec = 120; LocationManager = null; //setup Google Analytics GAI.SharedInstance.DispatchInterval = 20; GAI.SharedInstance.TrackUncaughtExceptions = true; Tracker = GAI.SharedInstance.GetTracker(TrackingId); return(true); }
public FavoritesTableSource() { AppDelegate appDelegate = UIApplication.SharedApplication.Delegate as AppDelegate; FavoritesDbManager favorites = appDelegate.FavoriteLocations; mFavorites = favorites.GetFavoriteLocations() as List <FavoriteLocation>; }
partial void StarStartClicked(MonoTouch.Foundation.NSObject sender) { AppDelegate appDelegate = UIApplication.SharedApplication.Delegate as AppDelegate; FavoritesDbManager favorites = appDelegate.FavoriteLocations; FavoriteLocation fav = new FavoriteLocation(); fav.Location = txtStartLocation.Text; favorites.SaveFavoriteLocation(fav); UIAlertView alert = new UIAlertView("Saved", "Location saved to favorites.", null, "OK", null); alert.Show(); }
public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, MonoTouch.Foundation.NSIndexPath indexPath) { AppDelegate appDelegate = UIApplication.SharedApplication.Delegate as AppDelegate; FavoritesDbManager favorites = appDelegate.FavoriteLocations; switch (editingStyle) { case UITableViewCellEditingStyle.Delete: // remove the item from the underlying data source FavoriteLocation fav = mFavorites [indexPath.Row]; favorites.DeleteFavoriteLocation(fav); // delete the row from the table mFavorites.RemoveAt(indexPath.Row); tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade); break; case UITableViewCellEditingStyle.None: Console.WriteLine("CommitEditingStyle:None called"); break; } }
protected FavoritesRepository() { db = new FavoritesDbManager(FavoritesDbManager.DatabaseFilePath); }