public override async void ViewDidLoad() { base.ViewDidLoad(); NewsItemGrabber _newsItemGrabber; _newsItemGrabber = new NewsItemGrabber(); LocalBhasvicDB.createNewsItemTable(); var jsonString = await _newsItemGrabber.getNews(); Console.WriteLine(jsonString); LocalBhasvicDB.updateDBWithJSON(jsonString); Console.WriteLine(LocalBhasvicDB.getItemList()); // Initialise AlertCategory Table if this is the first time the App is run if (LocalBhasvicDB.getTableInfo("AlertCategory").Count == 0) { LocalBhasvicDB.createAlertCategoryTable(); var alertCat = new AlertCategory(); foreach (var category in ChosenCategories.categories) { alertCat.Alert = true; alertCat.Category = category; LocalBhasvicDB.updateAlertCategoryTable(alertCat); } } }
public override void ViewWillAppear(bool animated) { TableView.Source = new EventsTableSource(LocalBhasvicDB.getItemList()); base.ViewWillAppear(animated); }
public override void ViewWillAppear(bool animated) { Console.WriteLine(ChosenCategories.ChosenCategory); //TableView.Source = new HomeTableSource(LocalBhasvicDB.getCatItemList(ChosenCategories.ChosenCategory)); if (ChosenCat == "All") { TableView.Source = new HomeTableSource(LocalBhasvicDB.getItemList()); } else { TableView.Source = new HomeTableSource(LocalBhasvicDB.getCatItemList(ChosenCat)); } CatLabel.Text = ChosenCat; base.ViewWillAppear(animated); }
public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { var alertCat = LocalBhasvicDB.getAlertCategory(alertCatList.ElementAt(indexPath.Row).Category); if (alertCat.Category != "General") { alertCat.Switch(); Console.WriteLine(alertCat.Category); LocalBhasvicDB.updateAlertCategoryTable(alertCat); tableView.DeselectRow(indexPath, true); } tableView.ReloadData(); }
static public bool initialiseAlertTable() { if (LocalBhasvicDB.getTableInfo("AlertCategory").Count == 0) { LocalBhasvicDB.createAlertCategoryTable(); var alertCat = new AlertCategory(); foreach (var category in ChosenCategories.categories) { alertCat.Alert = true; alertCat.Category = category; LocalBhasvicDB.updateAlertCategoryTable(alertCat); } } return(true); }
public override void ViewDidLoad() { base.ViewDidLoad(); NewsItemGrabber _newsItemGrabber; _newsItemGrabber = new NewsItemGrabber(); LocalBhasvicDB.createNewsItemTable(); //var jsonString = await _newsItemGrabber.getNews(); Task.Run(async() => { jsonString = await _newsItemGrabber.getNews(); }); while (jsonString.Equals("NotSet")) { } ; Console.WriteLine(jsonString); LocalBhasvicDB.updateDBWithJSON(jsonString); Console.WriteLine(LocalBhasvicDB.getItemList()); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell(cellidentifier); if (cell == null) { cell = new UITableViewCell(UITableViewCellStyle.Default, cellidentifier); } var alertCat = LocalBhasvicDB.getAlertCategory(alertCatList.ElementAt(indexPath.Row).Category); cell.TextLabel.Text = alertCatList.ElementAt(indexPath.Row).Category; if (alertCat.Alert == true) { cell.Accessory = UITableViewCellAccessory.Checkmark; } else { cell.Accessory = UITableViewCellAccessory.None; } return(cell); }
public override void ViewWillAppear(bool animated) { TableView.Source = new AlertCategoriesTableSource(LocalBhasvicDB.getAllAlertCategories()); base.ViewWillAppear(animated); }
public override void ViewWillAppear(bool animated) { Console.WriteLine(ChosenCategories.ChosenCategory); TableView.Source = new HomeTableSource(LocalBhasvicDB.getCatItemList(ChosenCategories.ChosenCategory)); base.ViewWillAppear(animated); }