Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
- {
- switch (editingStyle)
- {
- case UITableViewCellEditingStyle.Delete:
- Ticket ticket = TableItems[indexPath.Row];
- // remove the item from the underlying data source
- new Thread(new ThreadStart(async () =>
- {
- await TicketsInfo.DeleteTicket(ticket);
- await TicketsInfo.DeleteMessagesConnectedWithTicket(ticket);
- })).Start();
- TableItems.RemoveAt(indexPath.Row);
- tableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade);
- break;
- case UITableViewCellEditingStyle.None:
- Console.WriteLine("CommitEditingStyle:None called");
- break;
- }
- }
- public override bool CanEditRow(UITableView tableView, NSIndexPath indexPath)
- {
- return (Profile.Instance != null && Profile.Instance.Status == "Admin") ? true : false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement