本文整理汇总了C#中UITableViewCellEditingStyle类的典型用法代码示例。如果您正苦于以下问题:C# UITableViewCellEditingStyle类的具体用法?C# UITableViewCellEditingStyle怎么用?C# UITableViewCellEditingStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UITableViewCellEditingStyle类属于命名空间,在下文中一共展示了UITableViewCellEditingStyle类的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
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;
}
}
示例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
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;
}
}
示例3: CommitEditingStyle
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 ();
}
}
}
示例4: CommitEditingStyle
public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
{
if (editingStyle != UITableViewCellEditingStyle.Delete)
return;
OnElementDeleted (Root[indexPath.Section][indexPath.Row], indexPath);
}
示例5: 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);
}
}
示例6: CommitEditingStyle
public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, MonoTouch.Foundation.NSIndexPath indexPath)
{
if(editingStyle == UITableViewCellEditingStyle.Delete)
{
this.RaiseTaskDeleted(indexPath.Row);
}
}
示例7: 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);
}
}
示例8: CommitEditingStyle
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;
}
};
}
示例9: CommitEditingStyle
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);
}
}
示例10: CommitEditingStyle
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;
}
}
示例11: CommitEditingStyle
public void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
{
if (editingStyle == UITableViewCellEditingStyle.Delete)
{
_glResults.RemoveAt (indexPath.Row);
this.TableView.ReloadData ();
}
}
示例12: BookmarksViewController
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;
}
示例13: BookmarksVC
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;
}
示例14: CommitEditingStyle
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 ();
}
}
示例15: 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);
}