当前位置: 首页>>代码示例>>C#>>正文


C# UITableView.DeleteRows方法代码示例

本文整理汇总了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;
            }
        }
开发者ID:KuroiAme,项目名称:Indexer,代码行数:31,代码来源:TableSourceItems.cs

示例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;
     }
 }
开发者ID:reknih,项目名称:informant-ios,代码行数:34,代码来源:TableSource.cs

示例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);
     }
 }
开发者ID:phamthangnd,项目名称:TIG-CrossPlatformMobile,代码行数:7,代码来源:TasksTableViewSource.cs

示例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);
     }
 }
开发者ID:pensacola1989,项目名称:TIG-CrossPlatformMobile,代码行数:7,代码来源:TasksTableViewSource.cs

示例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);
		}
开发者ID:GouriKumari,项目名称:SubmissionSamples,代码行数:9,代码来源:CKReferenceDetailViewController.cs

示例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);
     }
 }
开发者ID:runegri,项目名称:MuPP,代码行数:10,代码来源:SimpleBusStopTableViewSource.cs

示例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;
				}
			}
开发者ID:89sos98,项目名称:sqlite-net,代码行数:10,代码来源:StocksView.xib.cs

示例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);
            }
        }
开发者ID:jimallen,项目名称:BoiseCodeCamp,代码行数:10,代码来源:TaskTableSource.cs

示例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;
     }
 }
开发者ID:steveperkins,项目名称:fans-of-fury,代码行数:11,代码来源:PlayerTableViewSource.cs

示例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 };
 }
开发者ID:erdennis13,项目名称:EthansList,代码行数:11,代码来源:SavedPostingsTableViewSource.cs

示例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;
            }
        }
开发者ID:sushant3239,项目名称:MultiLevelListView_WP,代码行数:13,代码来源:MyTableViewSource.cs

示例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);
            }
        }
开发者ID:gshackles,项目名称:MobileDevelopmentInCSharpBook,代码行数:13,代码来源:NoteListTableViewSource.cs

示例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;
            }
        }
开发者ID:LettuceDate,项目名称:LettuceMobile,代码行数:13,代码来源:DateActivityDataSource.cs

示例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
				}
			}
开发者ID:CodeMangler,项目名称:XamarinUniversity,代码行数:15,代码来源:FavoritesViewController.cs

示例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;
     }
 }
开发者ID:reknih,项目名称:informant-ios,代码行数:14,代码来源:GroupTableSource.cs


注:本文中的UITableView.DeleteRows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。