Exemplo n.º 1
0
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, MonoTouch.Foundation.NSIndexPath indexPath)
 {
     switch (editingStyle) {
     case UITableViewCellEditingStyle.Delete:
         // remove the item from the underlying data source
         string del;
         if (tableItems [indexPath.Row].AltFach != "" && tableItems [indexPath.Row].Lehrer != "") {
             del = tableItems [indexPath.Row].AltFach + "%" + tableItems [indexPath.Row].Lehrer;
         } else {
             del = tableItems [indexPath.Row].Fach + "%" + tableItems [indexPath.Row].Vertreter;
         }
         int there;
         var pm = new PrefManager ();
         try {
             there = pm.getInt ("ignoredCount");
             if (there == 0) {
                 throw new Exception ();
             }
         } catch {
             pm.setInt ("ignoredCount", 0);
             there = 0;
         }
         there++;
         pm.setString ("ignored" + Convert.ToString(there), del);
         pm.setInt ("ignoredCount", there);
         tableItems.RemoveAt(indexPath.Row);
         // delete the row from the table
         tableView.DeleteRows (new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
         break;
     case UITableViewCellEditingStyle.None:
         Console.WriteLine ("CommitEditingStyle:None called");
         break;
     }
 }
Exemplo n.º 2
0
 public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
 {
     var pm = new PrefManager ();
     pm.setInt ("group", indexPath.Row + 1);
     tableView.DeselectRow (indexPath, true); // normal iOS behaviour is to remove the grey-ish highlight
     _sv.changeView ();
     if (UIDevice.CurrentDevice.UserInterfaceIdiom != UIUserInterfaceIdiom.Phone) {
         ((VplanSuperViewController)_sv.SplitViewController).highwayToHell ();
     }
 }