public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
 {
     SelectedItem = indexedTableItems [keys [indexPath.Section]].ElementAt (indexPath.Row);
     if (this.ItemSelected != null)
     {
         this.ItemSelected (this, new EventArgs ());
     }
 }
 public void UpdateCell(Player record)
 {
     playerLabel.Text = string.Format ("{0} {1} ({2})", record.Name, record.FirstNames, record.PlayerNumber);
 }
		public void PlayerPicked(Player player)
		{
			try
			{
				uipocPlayerPicker.Dismiss(true);
				if(player.Id > 0)
				{
					if(Round.UseEntries)
					{
						// Check if player has unfinished entries.
						int? entryId = AppDelegate.Self.ApiClient.Get(new GetPlayerCurrentEntry { RoundId = Round.Id, PlayerId = player.Id });
						if(entryId.HasValue) {
							OpenEntry = entryId.Value;
							ProcessEntry(null, new UIButtonEventArgs(1));
//							var games = AppDelegate.Self.ApiClient.Get(new FindGames { RoundId = Round.Id, EntryNumber = OpenEntry});
//							if(games.Count == 0)
//								// Entry has no games sofar, use it
//								ProcessEntry(null, new UIButtonEventArgs(1));
//							else
//							{
//								// Ask to void or use
//								UIActionSheet actionSheet = new UIActionSheet(
//									string.Format("An open entry was found ({0}).{1}Please pick an option:", entryId, Environment.NewLine),
//									null, "Cancel", "Void this entry", new string[] {"Use this entry", "Cancel"});
//								actionSheet.Clicked += ProcessEntry;
//								actionSheet.ShowInView(this.View);
//							}
							return;
						}
						else
						{
							var tp = AppDelegate.Self.ApiClient.Post(new RegisterPlayer { RoundId = Round.Id, PlayerId = player.Id });
							PlayerNumberValue = (int)tp.EntryNumber;
							txtPlayer.Text = PlayerNumberValue.ToString();
						}
					}
					else
					{
						PlayerNumberValue = player.PlayerNumber;
						txtPlayer.Text = PlayerNumberValue.ToString();
					}
					PlayerNumberChanged(txtPlayer);
				}
			}
			catch (Exception ex)
			{
				ShowMessage(string.Format("There was a problem registering the score. Please try again.{0}{1}", Environment.NewLine, ex.Message));
			}
		}