private UITableViewCell GetCellSectionTwo(UITableView tableView, NSIndexPath indexPath) { NameValueCell cell; switch (indexPath.Row) { case 0: cell = new NameValueCell ("company", () => UserProfile.Company, v => UserProfile.Company= v); cell.ValueTextField.AutocapitalizationType = UITextAutocapitalizationType.Words; cell.ValueTextField.AutocorrectionType = UITextAutocorrectionType.No; break; case 1: cell = new NameValueCell ("title", () => UserProfile.Title, v => UserProfile.Title= v); cell.ValueTextField.AutocapitalizationType = UITextAutocapitalizationType.Words; cell.ValueTextField.AutocorrectionType = UITextAutocorrectionType.No; break; default: throw new IndexOutOfRangeException ("indexPath.Row out of range."); } return cell.LoadCell (tableView); }
private UITableViewCell GetCellSectionThree(UITableView tableView, NSIndexPath indexPath) { UITableViewCell cell; NameValueCell nameValueCell; switch (indexPath.Row) { case 0: nameValueCell = new NameValueCell ("e-mail", () => UserProfile.Email, v => UserProfile.Email= v); nameValueCell.ValueTextField.KeyboardType = UIKeyboardType.EmailAddress; nameValueCell.ValueTextField.AutocapitalizationType = UITextAutocapitalizationType.None; nameValueCell.ValueTextField.AutocorrectionType = UITextAutocorrectionType.No; cell = nameValueCell.LoadCell (tableView); if (ContactHelper.CanEMailPerson (UserProfile.Email)) cell.SelectionStyle = UITableViewCellSelectionStyle.Blue; break; case 1: nameValueCell = new NameValueCell ("phone", () => UserProfile.Phone, v => UserProfile.Phone= v); nameValueCell.ValueTextField.KeyboardType = UIKeyboardType.PhonePad; nameValueCell.ValueTextField.AutocorrectionType = UITextAutocorrectionType.No; nameValueCell.ValueTextField.ShouldChangeCharacters = PhoneNumberHelper.ShoudChange; cell = nameValueCell.LoadCell (tableView); if (ContactHelper.CanCallPerson (UserProfile.Phone)) cell.SelectionStyle = UITableViewCellSelectionStyle.Blue; break; default: throw new IndexOutOfRangeException ("indexPath.Row out of range."); } return cell; }