Beispiel #1
0
		public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
		{
			var dog = DogList.ElementAt(indexPath.Row);
			
			var actionSheet = new UIActionSheet("") {"Slett hund", Utils.Translate("cancel")};
			actionSheet.Title = dog.Navn + " vil bli slettet og fjernet fra alle logger.";
			actionSheet.DestructiveButtonIndex = 0;
			actionSheet.CancelButtonIndex = 1;
			actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
			
			actionSheet.Clicked += delegate(object sender, UIButtonEventArgs e) {
				Console.WriteLine(e.ButtonIndex);
				switch (e.ButtonIndex)
				{
				case 0:
					//Slett
					JaktLoggApp.instance.DeleteDog(dog);
					_controller.Refresh();
					break;
				case 1:
					//Avbryt
					break;
				}
			};
		}
		public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
		{
			if (editingStyle == UITableViewCellEditingStyle.Delete) {
				FlexGrid.Columns.RemoveAt (indexPath.Row);
				this.TableView.DeleteRows (new NSIndexPath[]{ indexPath }, UITableViewRowAnimation.Automatic);
			}
		}
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     if (editingStyle == UITableViewCellEditingStyle.Delete)
     {
         _deleteListener?.Invoke(_motorcycles[indexPath.Row]);
     }
 }
Beispiel #4
0
            public async override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
            {
                var contact = viewModel.ContactsGrouped[indexPath.Section][indexPath.Row];
                await viewModel.DeleteContact(contact);

                tableView.ReloadData();
            }
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            if (editingStyle != UITableViewCellEditingStyle.Delete)
                return;

            OnElementDeleted (Root[indexPath.Section][indexPath.Row], indexPath);
        }
Beispiel #6
0
            public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
            {
                var account = (parent.Root [indexPath.Section][indexPath.Row] as AccountElement).Account;

                parent.Root [indexPath.Section].Remove(indexPath.Row);
                TwitterAccount.Remove(account);
            }
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     if (editingStyle == UITableViewCellEditingStyle.Delete)
     {
         RemoveServiceAtIndexPath(indexPath);
     }
 }
            //Delete a question
            public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, Foundation.NSIndexPath indexPath)
            {
                switch (editingStyle)
                {
                case UITableViewCellEditingStyle.Delete:

                    //Find question in the list using it's questionID
                    var itemToRemove = ListofTriviaQuestions.Single(r => r.QuestionID == ListofTriviaQuestions[indexPath.Row].QuestionID);

                    //Remove question from the list
                    ListofTriviaQuestions.Remove(itemToRemove);

                    //Save changes to json file
                    var myJson = JsonConvert.SerializeObject(ListofTriviaQuestions);

                    using (var streamwriter = new StreamWriter(AppDelegate.triviaPathFile, false))
                    {
                        streamwriter.Write(myJson);
                    }

                    // delete the row from the table
                    tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
                    break;

                case UITableViewCellEditingStyle.None:
                    Console.WriteLine("CommitEditingStyle:None called");
                    break;
                }
            }
Beispiel #9
0
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            var dvc = Container as Screens.CategoriesScreen;

            switch (editingStyle)
            {
            case UITableViewCellEditingStyle.Delete:

                var section = Container.Root[indexPath.Section];
                var element = section[indexPath.Row] as StringElement;

                section.Remove(element);

                if (dvc != null)
                {
                    dvc.DeleteCategoryRow(indexPath.Row);
                }

                break;

            case UITableViewCellEditingStyle.None:
                Console.WriteLine("CommitEditingStyle:None called");
                break;
            }
        }
Beispiel #10
0
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     if (editingStyle == UITableViewCellEditingStyle.Delete)
     {
         UnassignAccessory(Accessories [indexPath.Row]);
     }
 }
Beispiel #11
0
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, MonoTouch.Foundation.NSIndexPath indexPath)
 {
     if (editingStyle == UITableViewCellEditingStyle.Delete)
     {
         this.RaiseTaskDeleted(indexPath.Row);
     }
 }
		public async override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle,	NSIndexPath indexPath)
		{
			if (editingStyle == UITableViewCellEditingStyle.Delete) {
				var selectedObject = controller.DataSource.Objects.ElementAtOrDefault (indexPath.Row);

				try 
				{
					RootViewController.SetLoadingState(true);
					var deleted = await controller.Client.DeleteAsync (selectedObject);
					if (deleted)
						objects.Remove (selectedObject);
				}
				catch (InsufficientRightsException) 
				{
					ShowInsuffientRightsMessage (tableView);
				}
				catch (DeleteFailedException ex) 
				{
					ShowDeleteFailedMessage (tableView, ex);
				}
				finally
				{
					RootViewController.SetLoadingState(false);
					tableView.ReloadData ();
				}
			}
		}
Beispiel #13
0
 /// <summary>
 /// Working.
 /// </summary>
 public BookmarksViewController(int docId, List <DocumentBookmark> bookmarks, int currentPageNumber, Action <object> callbackAction) : base(null, null, callbackAction)
 {
     _DocumentId        = docId;
     _Bookmarks         = bookmarks;
     _CurrentPageNumber = currentPageNumber;
     _EditMode          = UITableViewCellEditingStyle.None;
 }
        /// <summary>
        /// Defines what happens when the delete action is confirmed.
        /// Then the device is removed from the server and the list.
        /// </summary>
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, Foundation.NSIndexPath indexPath)
        {
            if (Globals.LocalLogin)
            {
                try
                {   // remove device from server
                    Globals.LocalServerinteractor.RemoveDevice(serverDevices[indexPath.Section][indexPath.Row]);
                }
                catch (ServerInteractionException ex)
                {
                    Console.WriteLine("Exception while removing device. (Bug in server: exception is always thrown)");
                    Console.Out.WriteLine(ex);
                }
            }
            else // Global login
            {
                var deviceInRow            = serverDevices[indexPath.Section][indexPath.Row];
                var deviceServerInteractor = deviceInRow.ServerInteractor;
                try
                {
                    deviceServerInteractor.RemoveDevice(deviceInRow);
                }
                catch (ServerInteractionException ex)
                {
                    Console.WriteLine("Exception while removing device. (Bug in server: exception is always thrown)");
                    Console.Out.WriteLine(ex);
                }
            }
            // Remove device from list that is shown in the TableView
            RemoveDeviceAt(indexPath);

            // Delete the row from the table
            tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
        }
Beispiel #15
0
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     if (this.OnShouldCommitEditingStyle != null)
     {
         this.OnShouldCommitEditingStyle(tableView, editingStyle, indexPath);
     }
 }
Beispiel #16
0
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, Foundation.NSIndexPath indexPath)
        {
            switch (editingStyle)
            {
            case UITableViewCellEditingStyle.Delete:

                this.ShowHUD("Deleting Group");
                Task.Run(async() =>
                {
                    PersonGroupModel pg = Groups[indexPath.Row];
                    await PersonGroupClient.Shared.DeletePersonGroup(pg.Id);
                    BeginInvokeOnMainThread(() =>
                    {
                        // remove the item from the underlying data source
                        Groups.RemoveAt(indexPath.Row);
                        // delete the row from the table
                        tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
                        this.ShowSimpleHUD("Group deleted");
                    });
                });

                break;

            case UITableViewCellEditingStyle.None:
                Console.WriteLine("CommitEditingStyle:None called");
                break;
            }
        }
            public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
            {
                if (editingStyle == UITableViewCellEditingStyle.Delete)
                {
                    // get the folder from the local collection, and refresh it from the viewmodel in case
                    // it changed underneath us
                    Folder folder = controller.Folders[indexPath.Row];
                    if (App.ViewModel.Folders.Any(f => f.ID == folder.ID))
                    {
                        folder = App.ViewModel.Folders.Single(f => f.ID == folder.ID);
                    }

                    // enqueue the Web Request Record
                    RequestQueue.EnqueueRequestRecord(RequestQueue.UserQueue,
                                                      new RequestQueue.RequestRecord()
                    {
                        ReqType = RequestQueue.RequestRecord.RequestType.Delete,
                        Body    = folder
                    });

                    // save the changes to local storage
                    App.ViewModel.FolderDictionary.Remove(folder.ID);
                    App.ViewModel.Folders.Remove(folder);
                    StorageHelper.WriteFolders(App.ViewModel.Folders);
                    StorageHelper.DeleteFolder(folder);

                    // refresh the table UI
                    controller.SortFolders();
                    tableView.DeleteRows(new [] { indexPath }, UITableViewRowAnimation.Fade);
                }
            }
        public override async void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle,
                                                      NSIndexPath indexPath)
        {
            if (editingStyle != UITableViewCellEditingStyle.Delete)
            {
                return;
            }

            using (var client = new TarefaService())
            {
                try
                {
                    await client.DeleteAsync(_tarefas[indexPath.Row]);
                }
                catch (Exception)
                {
                    const string retorno = "Ocorreu um erro ao realizar operação! Por favor, tente novamente mais tarde!";
                    new UIAlertView("Deletar Tarefa", retorno, null, "OK", null).Show();
                    return;
                }
            }

            using (var client = new TarefaService())
            {
                _tarefas = await client.ListarAsync();
            }

            if (_tarefas != null && _tarefas?.Count > 0)
            {
                TableView.ReloadData();
            }
        }
Beispiel #19
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
                this.RaiseTaskDeleted(indexPath.Row);
                tableItems.RemoveAt(indexPath.Row);
                // delete the row from the table
                tableView.DeleteRows (new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);

                break;

            case UITableViewCellEditingStyle.Insert:
                //---- create a new item and add it to our underlying data

                Item obj = new Item();
                obj.Name = "Inserted";
                obj.Description ="Placeholder";
            //				obj.imageFileName = "second.png";

                tableItems.Insert (indexPath.Row, obj);

                //---- insert a new row in the table
                tableView.InsertRows (new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
                break;

            case UITableViewCellEditingStyle.None:
                Console.WriteLine ("CommitEditingStyle:None called");
                break;
            }
        }
Beispiel #20
0
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            if (editingStyle != UITableViewCellEditingStyle.Delete)
            {
                return;
            }

            var comparison = _tableView.Comparisons[indexPath.Row];

            if (!DataService.DeleteComparison(comparison.Id))
            {
                new UIAlertView("Info", "Comparison was not found. Could not delete.", null, "Dismiss").Show();
            }

            if (!_tableView.Comparisons.Remove(comparison))
            {
                new UIAlertView("Info", "Comparison was not found in the list. Could not delete.", null, "Dismiss").Show();
            }

            if (_tableView.Comparisons.Count == 0)
            {
                _deletingLastRow = true;
            }

            _tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
        }
        public async override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            if (editingStyle == UITableViewCellEditingStyle.Delete)
            {
                var selectedObject = controller.DataSource.Objects.ElementAtOrDefault(indexPath.Row);

                try
                {
                    RootViewController.SetLoadingState(true);
                    var deleted = await controller.Client.DeleteAsync(selectedObject);

                    if (deleted)
                    {
                        objects.Remove(selectedObject);
                    }
                }
                catch (InsufficientRightsException)
                {
                    ShowInsuffientRightsMessage(tableView);
                }
                catch (DeleteFailedException ex)
                {
                    ShowDeleteFailedMessage(tableView, ex);
                }
                finally
                {
                    RootViewController.SetLoadingState(false);
                    tableView.ReloadData();
                }
            }
        }
Beispiel #22
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;
     }
 }
Beispiel #23
0
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            switch (editingStyle)
            {
            case UITableViewCellEditingStyle.Delete:
                var box = Boxes[indexPath.Row];
                Boxes.Remove(box);
                tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);

                var items = itemDAO.getAllItemInBox(box.Id);

                foreach (var i in items)
                {
                    i.Container = 0;
                    itemDAO.updateItem(i);
                }
                boxDAO.deleteBox(box);

                break;

            case UITableViewCellEditingStyle.None:
                break;

            default:
                break;
            }
        }
Beispiel #24
0
 public async override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     if (editingStyle == UITableViewCellEditingStyle.Delete)
     {
         await DeleteExpense(indexPath.Row, indexPath);
     }
 }
Beispiel #25
0
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, Foundation.NSIndexPath indexPath)
        {
            switch (editingStyle)
            {
            case UITableViewCellEditingStyle.Delete:
                // remove the item from the underlying data source
                sourceSensor.RemoveSensorProperty(sourceSensor.sensorProperties[indexPath.Row]);
                if (sourceSensor.sensorProperties.Count.Equals(0))
                {
                    tableSensors.subviewHide.SetImage(null, UIControlState.Normal);
                }
                // delete the row from the table
                tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
                break;

            case UITableViewCellEditingStyle.Insert:
                //---- create a new item and add it to our underlying data
                //tableItems [indexPath.Section].Insert (indexPath.Row, new TableItem ("(inserted)"));
                //---- insert a new row in the table
                tableView.InsertRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
                break;

            case UITableViewCellEditingStyle.None:
                Console.WriteLine("CommitEditingStyle:None called");
                break;
            }
        }
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     if (editingStyle == UITableViewCellEditingStyle.Delete)
     {
         ViewModel.DeleteReminderCommand.Execute(ViewModel.Reminders[indexPath.Row]);
     }
 }
Beispiel #27
0
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            switch (editingStyle)
            {
            case UITableViewCellEditingStyle.Delete:
                // remove the item from the underlying data source
                owner.DeleteItem(tableItems[indexPath.Row]);
                tableItems.RemoveAt(indexPath.Row);
                // delete the row from the table
                tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
                break;

            case UITableViewCellEditingStyle.Insert:
                //---- create a new item and add it to our underlying data
                var newItem = new VTSModel();
                newItem.VacationType = "inserted";
                tableItems.Insert(indexPath.Row, newItem);
                //---- insert a new row in the table
                tableView.InsertRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
                break;

            case UITableViewCellEditingStyle.None:
                Console.WriteLine("CommitEditingStyle:None called");
                break;
            }
        }
Beispiel #28
0
        public override async void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            switch (editingStyle)
            {
            case UITableViewCellEditingStyle.Delete:

                var member = tableItems.ElementAt(indexPath.Row);

                if (!member.Id.Equals(LoginController.userModel.id))
                {
                    // remove the item from the underlying data source
                    tableItems.RemoveAt(indexPath.Row);
                    // delete the row from the table
                    tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);

                    await new UserGroupManager().UpdateGroupRelationshipStatus(LoginController.tokenModel.access_token, groupId, member.Id, UserGroupRelationshipStatus.Unmembered);
                }
                else
                {
                    Utils.ShowToast("Can't remove group admin", 3000);
                }
                break;

            case UITableViewCellEditingStyle.Insert:

                Console.WriteLine("CommitEditingStyle:Insert called");
                break;

            case UITableViewCellEditingStyle.None:
                Console.WriteLine("CommitEditingStyle:None called");
                break;
            }
        }
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            if (editingStyle != UITableViewCellEditingStyle.Delete)
            {
                return;
            }

            // Delete the document from the database.

            var row           = RowAtIndex(indexPath.Row);
            var tableDelegate = TableView.Delegate as CouchBaseTableDelegate;

            if (tableDelegate != null)
            {
                if (!tableDelegate.DeleteRow(this, row))
                {
                    return;
                }
            }
            else
            {
                if (row.Document.CurrentRevision.DeleteDocument() != null)
                {
                    tableDelegate.DeleteFailed(this);
                    return;
                }
            }

            // Delete the row from the table data source.
            Rows.ToList().RemoveAt(indexPath.Row);
            TableView.DeleteRows(
                atIndexPaths: new[] { indexPath },
                withRowAnimation: UITableViewRowAnimation.Fade
                );
        }
Beispiel #30
0
        //borrado con un deslizamiento
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, Foundation.NSIndexPath indexPath)
        {
            switch (editingStyle)
            {
            case UITableViewCellEditingStyle.Delete:
                // remove the item from the underlying data source
                var fileName         = "dbCRM.db3";
                var documentsPath    = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                var libraryPath      = Path.Combine(documentsPath, "..", "Library");
                var path             = Path.Combine(libraryPath, fileName);
                IContactRepository a = new SQLiteContactRepository(path);

                Contact c = TableItems[indexPath.Row];
                a.Delete(c);
                // delete the row from the table
                TableItems.RemoveAt(indexPath.Row);
                tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);

                break;

            case UITableViewCellEditingStyle.None:
                Console.WriteLine("Borrar: " + TableItems[indexPath.Row].contactName);
                break;
            }
        }
Beispiel #31
0
		public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, MonoTouch.Foundation.NSIndexPath indexPath)
		{
			if(editingStyle == UITableViewCellEditingStyle.Delete)
			{
				this.RaiseTaskDeleted(indexPath.Row);
			}
		}
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     if (editingStyle == UITableViewCellEditingStyle.Delete)
     {
         taskMgr.DeleteTask(_rows[indexPath.Row]);
     }
 }
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     if (editingStyle == UITableViewCellEditingStyle.Delete) {
         tasks.RemoveAt (indexPath.Row);
         tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Top);
     }
 }
Beispiel #34
0
        public void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            switch (editingStyle)
            {
            case UITableViewCellEditingStyle.Delete:
                //---- remove the item from the underlying data source
                items[indexPath.Section].Items.RemoveAt(indexPath.Row);

                //---- delete the row from the table
                tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
                break;

            case UITableViewCellEditingStyle.Insert:
                //---- create a new item and add it to our underlying data
                items[indexPath.Section].Items.Insert(indexPath.Row, new TableItem {
                    Heading = "(inserted)"
                });

                //---- insert a new row in the table
                tableView.InsertRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
                break;

            case UITableViewCellEditingStyle.None:
                Console.WriteLine("CommitEditingStyle:None called");
                break;
            }
        }
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     if (viewModel != null)
     {
         if (editingStyle == UITableViewCellEditingStyle.Delete)
         {
             if (ExecuteCommand(deleteRowCommandName, GetItem(indexPath)))
             {
                 if (!listIsObservable)
                 {
                     tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Automatic);
                 }
             }
         }
         else if (editingStyle == UITableViewCellEditingStyle.Insert)
         {
             if (ExecuteCommand(insertRowCommandName, GetItem(indexPath)))
             {
                 if (!listIsObservable)
                 {
                     tableView.InsertRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Automatic);
                 }
             }
         }
     }
 }
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            var contact = contacts[indexPath.Row];

            if (editingStyle == UITableViewCellEditingStyle.Delete)
            {
                var alertController = UIAlertController.Create("Delete Contact",
                                                               string.Format("Are you sure you want to delete {0}", contact.Name),
                                                               UIAlertControllerStyle.Alert);

                alertController.AddAction(UIAlertAction.Create("Yes", UIAlertActionStyle.Default, delegate
                {
                    contacts.Remove(contact);
                    tableView.ReloadData();
                }));

                alertController.AddAction(UIAlertAction.Create("No", UIAlertActionStyle.Cancel, delegate { }));

                parent.PresentViewController(alertController, true, null);
            }
            else
            {
                base.CommitEditingStyle(tableView, editingStyle, indexPath);
            }
        }
Beispiel #37
0
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            switch (editingStyle)
            {
            case UITableViewCellEditingStyle.Delete:

                int i = Datas.RestoreDeletedTask(_deletedDataTasks[indexPath.Row].Id);

                if (i != -999)
                {
                    _deletedDataTasks.RemoveAt(indexPath.Row);                                               // From Local Datas
                    tempTableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade); // Table row Deleting
                }

                break;



            case UITableViewCellEditingStyle.None:

                Console.WriteLine("Commiting Edit Style");

                break;
            }
        }
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     if (editingStyle == UITableViewCellEditingStyle.Delete) {
         _taskManager.RemoveItem(_taskManager.TodoItems[indexPath.Row]);
         tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Top);
     }
 }
            public async override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
            {
                var expense = viewModel.Expenses[indexPath.Row];
                await viewModel.ExecuteDeleteExpenseCommand(expense);

                tableView.ReloadData();
            }
		public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, Foundation.NSIndexPath indexPath)
		{
			switch (editingStyle) {
			case UITableViewCellEditingStyle.Delete:
				TenServiceHelper.DeleteComment (Master.post, Master.TableItems [indexPath.Row], tableView, indexPath, Master.TableItems);
				break;
			}
		}
 public BookmarksViewController(int docId, List<DocumentBookmark> bookmarks, int currentPageNumber, Action<object> callbackAction)
     : base(null, null, callbackAction)
 {
     mDocumentId = docId;
     mBookmarks = bookmarks;
     mCurrentPageNumber = currentPageNumber;
     mEditMode = UITableViewCellEditingStyle.None;
 }
 public void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     if (editingStyle == UITableViewCellEditingStyle.Delete)
     {
         _glResults.RemoveAt (indexPath.Row);
         this.TableView.ReloadData ();
     }
 }
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     if (editingStyle == UITableViewCellEditingStyle.Delete) {
         var medList = new List<Medication> (controller.parentController.pet.medications);
         medList.RemoveAt (indexPath.Row);
         controller.parentController.pet.medications = medList.ToArray ();
         tableView.ReloadData ();
     }
 }
		public override async void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
		{
			if (editingStyle != UITableViewCellEditingStyle.Delete)
				return;

			await CloudManager.DeleteAsync (records [indexPath.Row]);
			records.RemoveAt (indexPath.Row);
			tableView.DeleteRows (new [] { indexPath }, UITableViewRowAnimation.Fade);
		}
 public BookmarksVC(int docId, List<DocumentBookmark> bookmarks, int currentPageNumber, Action<object> callbackAction)
     : base(null, null)
 {
     _documentId = docId;
     _bookmarks = bookmarks;
     _currentPageNumber = currentPageNumber;
     _callbackAction = callbackAction;
     _editMode = UITableViewCellEditingStyle.None;
 }
			public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
			{
				//
				// In this method, we need to actually carry out the request
				//
				var section = Container.Root [indexPath.Section];
				var element = section [indexPath.Row];
				section.Remove (element);
			}
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     switch (editingStyle) {
     case UITableViewCellEditingStyle.Delete:
         viewModel.RemoveCommand.Execute (indexPath.Row);
         break;
     case UITableViewCellEditingStyle.None:
         break;
     }
 }
Beispiel #48
0
			public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
			{
				switch (editingStyle) {
				case UITableViewCellEditingStyle.Delete:
					_db.Delete(rows[indexPath.Row]);
					rows.RemoveAt(indexPath.Row);
					tableView.DeleteRows(new[]{indexPath}, UITableViewRowAnimation.Fade);
					break;
				}
			}
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     if(editingStyle == UITableViewCellEditingStyle.Delete)
     {
         var busStop = GetBusStop(indexPath);
         _busStops.Remove(busStop);
         _busStopRepository.RemoveFavorite(busStop);
         tableView.DeleteRows(new [] {indexPath}, UITableViewRowAnimation.Fade);
     }
 }
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, MonoTouch.Foundation.NSIndexPath indexPath)
        {
            if(editingStyle == UITableViewCellEditingStyle.Delete)
            {
                this.RaiseTaskDeleted(indexPath.Row);

                // delete the row from the table
                tableView.DeleteRows (new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
            }
        }
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, Foundation.NSIndexPath indexPath)
 {
     switch (editingStyle) {
     case UITableViewCellEditingStyle.Delete:
         var player = Players [indexPath.Row];
         _controller.DeletePlayer (player);
         Players.RemoveAt (indexPath.Row);
         tableView.DeleteRows (new Foundation.NSIndexPath[] { indexPath }, UITableViewRowAnimation.Left);
         break;
     }
 }
Beispiel #52
0
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, MonoTouch.Foundation.NSIndexPath indexPath)
 {
     switch (editingStyle)
     {
         case UITableViewCellEditingStyle.Delete:
             var section = _parent.Root[indexPath.Section];
             var element = section[indexPath.Row];
             _parent.Delete(element, section);
             break;
     }
 }
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, MonoTouch.Foundation.NSIndexPath indexPath)
 {
     switch (editingStyle)
     {
     case UITableViewCellEditingStyle.Delete:
         mMainModel.RemoveWordAt(indexPath.Row);
         break;
     case UITableViewCellEditingStyle.None:
         Console.WriteLine ("CommitEditingStyle:None called");
         break;
     }
 }
		public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, MonoTouch.Foundation.NSIndexPath indexPath)
		{
			if(editingStyle == UITableViewCellEditingStyle.Delete)
			{
				CodeProjectMember memberToDelete = MemberList [indexPath.Row];
				CodeProjectDatabase database = new CodeProjectDatabase ();
				database.DeleteMember (memberToDelete.Id);

				MemberList = database.GetMembers();
				tableView.ReloadData ();
			}
		}
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            //
            // In this method, we need to actually carry out the request
            //
            var section = Container.Root [indexPath.Section];
            var element = section [indexPath.Row] as StringElement;
            section.Remove (element);

            var dvc = Container as Screens.HomeScreen;
            dvc.DeleteTaskRow (indexPath.Row);
        }
 public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
 {
     switch (editingStyle)
     {
     case UITableViewCellEditingStyle.Delete:
         _viewModel.Orders[indexPath.Row].IsSelected = true;
         _viewModel.DeleteCommand.Execute(null);
         break;
     case UITableViewCellEditingStyle.None:
         break;
     }
 }
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            if (editingStyle != UITableViewCellEditingStyle.Delete)
                return;

            Section section = Root [indexPath.Section];
            ThemedFileElement fileElement = section [indexPath.Row] as ThemedFileElement;
            if (fileElement == null)
                return;
            string fullPath = BasePath.Expand (fileElement.Caption, fileElement.PathId);
            File.Delete (fullPath);
            section.Remove (indexPath.Row);
        }
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            switch (editingStyle) {
            case UITableViewCellEditingStyle.Delete:
                // to do - remove the item
                currentDate.activities.RemoveAt (indexPath.Row);
                tableView.DeleteRows (new NSIndexPath[]{ indexPath }, UITableViewRowAnimation.Fade);
                break;

            case UITableViewCellEditingStyle.None:
                break;
            }
        }
        public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
        {
            if (editingStyle == UITableViewCellEditingStyle.Delete)
            {
                var note = _notes[indexPath.Row];

                AppDelegate.NoteRepository.Delete(note.Id);

                _notes.Remove(note);

                tableView.DeleteRows(new[] { indexPath }, UITableViewRowAnimation.Fade);
            }
        }
 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
         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;
     }
 }