本文整理汇总了C#中UITableView.DeleteRows方法的典型用法代码示例。如果您正苦于以下问题:C# UITableView.DeleteRows方法的具体用法?C# UITableView.DeleteRows怎么用?C# UITableView.DeleteRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UITableView
的用法示例。
在下文中一共展示了UITableView.DeleteRows方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CommitEditingStyle
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;
}
}
示例2: CommitEditingStyle
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;
}
}
示例3: CommitEditingStyle
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);
}
}
示例4: CommitEditingStyle
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);
}
}
示例5: CommitEditingStyle
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);
}
示例6: CommitEditingStyle
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);
}
}
示例7: CommitEditingStyle
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;
}
}
示例8: CommitEditingStyle
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);
}
}
示例9: CommitEditingStyle
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;
}
}
示例10: EditActionsForRow
public override UITableViewRowAction[] EditActionsForRow(UITableView tableView, NSIndexPath indexPath)
{
var deletion = UITableViewRowAction.Create(UITableViewRowActionStyle.Destructive, " ", async delegate {
await AppDelegate.databaseConnection.DeletePostingAsync(savedListings[indexPath.Row]);
savedListings.RemoveAt(indexPath.Row);
tableView.DeleteRows(new [] { indexPath }, UITableViewRowAnimation.Fade);
Console.WriteLine (AppDelegate.databaseConnection.StatusMessage);
});
deletion.BackgroundColor = UIColor.FromPatternImage(UIImage.FromBundle("DeletePattern.png"));
return new UITableViewRowAction[]{ deletion };
}
示例11: DeleteRows
private void DeleteRows(TreeItem treeItem, UITableView tableView, int selectedItemIndex)
{
if (treeItem.Childrens != null) {
var itemsToRemove = new List<TreeItem> (treeItem.Childrens);
var itmesToRemovePath = new List<NSIndexPath> ();
int totalDeleteCount = 0;
RecursiveDelete (itemsToRemove, itmesToRemovePath, ref totalDeleteCount);
_items.RemoveRange (selectedItemIndex + 1, totalDeleteCount);
tableView.DeleteRows (itmesToRemovePath.ToArray (), UITableViewRowAnimation.Fade);
treeItem.IsExpanded = false;
}
}
示例12: CommitEditingStyle
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);
}
}
示例13: CommitEditingStyle
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;
}
}
示例14: CommitEditingStyle
// TODO: Step 7b: uncomment to enable editing within the table
public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
{
// This method allows you to adjust the model when you edit (Delete or Insert) a row
if (editingStyle == UITableViewCellEditingStyle.Delete) {
sessions.RemoveAt (indexPath.Row);
tableView.DeleteRows (new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Middle);
}
if (editingStyle == UITableViewCellEditingStyle.Insert) {
// Setup an add button or a special row in the table
// use tableView.InsertRows(...);
// Adjust the model to reflect that an insert has just happened
}
}
示例15: CommitEditingStyle
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;
}
}