コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        public override void ViewWillAppear(bool animated)
        {
            TableView.Source = new EventsTableSource(LocalBhasvicDB.getItemList());


            base.ViewWillAppear(animated);
        }
コード例 #3
0
 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);
 }
コード例 #4
0
        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();
        }
コード例 #5
0
ファイル: LocalBhasvicDB.cs プロジェクト: graceannx/Bhasvic10
 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);
 }
コード例 #6
0
        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());
        }
コード例 #7
0
        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);
        }
コード例 #8
0
 public override void ViewWillAppear(bool animated)
 {
     TableView.Source = new AlertCategoriesTableSource(LocalBhasvicDB.getAllAlertCategories());
     base.ViewWillAppear(animated);
 }
コード例 #9
0
 public override void ViewWillAppear(bool animated)
 {
     Console.WriteLine(ChosenCategories.ChosenCategory);
     TableView.Source = new HomeTableSource(LocalBhasvicDB.getCatItemList(ChosenCategories.ChosenCategory));
     base.ViewWillAppear(animated);
 }