public override void ViewWillDisappear(bool animated) { base.ViewWillDisappear(animated); var appDelegate = (AppDelegate)UIApplication.SharedApplication.Delegate; if (CheckMode.Equals("number") && appDelegate.Edited == true) { if (SelectedRowCountArr.Count == 0) { this.UpdateInfoWithMaxCountNum1Num2Num3(MaxCount, "0", "0", "0"); } else if (SelectedRowCountArr.Count == 1) { this.UpdateInfoWithMaxCountNum1Num2Num3(MaxCount, SelectedRowCountArr[0].ToString(), "", ""); } else if (SelectedRowCountArr.Count == 2) { this.UpdateInfoWithMaxCountNum1Num2Num3(MaxCount, SelectedRowCountArr[0].ToString(), SelectedRowCountArr[1].ToString(), ""); } else { this.UpdateInfoWithMaxCountNum1Num2Num3(MaxCount, SelectedRowCountArr[0].ToString(), SelectedRowCountArr[1].ToString(), SelectedRowCountArr[2].ToString()); } } }
public override void CommitEditingStyle(UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath) { if (CheckMode.Equals("number")) { var appDelegate = (AppDelegate)UIApplication.SharedApplication.Delegate; appDelegate.Edited = true; SelectedRowCountArr.RemoveAt(indexPath.Row); this.TableView.DeleteRows(new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade); } }
public override bool CanEditRow(UITableView tableView, NSIndexPath indexPath) { if (CheckMode.Equals("number")) { return(true); } else { return(false); } }
public override void RowDeselected(UITableView tableView, NSIndexPath indexPath) { tableView.DeselectRow(indexPath, true); var cell = tableView.CellAt(indexPath); if (CheckMode.Equals("count")) { cell.Accessory = UITableViewCellAccessory.None; } else if (CheckMode.Equals("number")) { cell.Accessory = UITableViewCellAccessory.None; arrayToDelete.Remove(SelectedRowCountArr[indexPath.Row]); } }
public override nint RowsInSection(UITableView tableView, nint section) { if (CheckMode.Equals("count")) { return(CountArray.Count); } else if (CheckMode.Equals("number")) { return(SelectedRowCountArr.Count); } else { return(0); } }
public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { var cell = tableView.CellAt(indexPath); if (CheckMode.Equals("count")) { cell.Accessory = UITableViewCellAccessory.Checkmark; this.UpdateInfoWithMaxCountNum1Num2Num3(Convert.ToInt16(CountArray[indexPath.Row]), SelectedRowCountArr[0].ToString(), SelectedRowCountArr[1].ToString(), SelectedRowCountArr[2].ToString()); this.NavigationController.PopViewController(true); } else if (CheckMode.Equals("number")) { arrayToDelete.Add(SelectedRowCountArr[indexPath.Row]); } }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell("Cell", indexPath); cell.SelectionStyle = UITableViewCellSelectionStyle.None; cell.Accessory = UITableViewCellAccessory.None; if (CheckMode.Equals("count")) { cell.SelectionStyle = UITableViewCellSelectionStyle.Default; cell.TextLabel.Text = String.Format("{0}개", CountArray[indexPath.Row].ToString()); if (Convert.ToInt32(MaxCount) == Convert.ToInt32(CountArray[indexPath.Row])) { cell.Accessory = UITableViewCellAccessory.Checkmark; } } else if (CheckMode.Equals("number")) { cell.TextLabel.Text = String.Format("{0}", SelectedRowCountArr[indexPath.Row]); } return(cell); }
public override void ViewDidLoad() { base.ViewDidLoad(); var appDelegate = (AppDelegate)UIApplication.SharedApplication.Delegate; MaxCount = appDelegate.UserInfo.maxSelectNumber; EditCheck = false; if (CheckMode.Equals("number")) { numbersData = new ArrayList(); for (int i = 1; i < 46; i++) { var temp = String.Format("{0}", i); numbersData.Add(temp); } arrayToDelete = new ArrayList(); if (SelectedRowCountArr == null) { SelectedRowCountArr = new ArrayList(); } //var newAddButton = new UIBarButtonItem("추가", UIBarButtonItemStyle.Plain, this, new ObjCRuntime.Selector("Add")); var newAddButton = new UIBarButtonItem("추가", UIBarButtonItemStyle.Plain, Add); this.NavigationItem.RightBarButtonItem = newAddButton; this.NavigationItem.Title = "고정번호선택"; } else if (CheckMode.Equals("count")) { this.NavigationItem.Title = "번호생성갯수"; } }