public override View GetChildView(int groupPosition, int childPosition, bool isLastChild, View convertView, ViewGroup parent) { Attack item = mydata[groupPosition]; View view = convertView; if (view == null) { view = myContext.LayoutInflater.Inflate(Resource.Layout.attack_expanded_listview, null); } TextView text1 = view.FindViewById <TextView>(Resource.Id.textView1); TextView text2 = view.FindViewById <TextView>(Resource.Id.textView2); TextView text3 = view.FindViewById <TextView>(Resource.Id.textView3); TextView text4 = view.FindViewById <TextView>(Resource.Id.textView4); PlayerDbManager dbPlayerManager = DbManager.Instance.PlayerDbManager; if (childPosition >= item.Shots.Count + item.Rebounds.Count) { if (item.Goal != null) { text1.Text = "Goal"; text2.Text = dbPlayerManager.GetPlayerById(item.Goal.PlayerId).FirstName; text3.Text = dbPlayerManager.GetPlayerById(item.Goal.AssistPlayerId).FirstName; text4.Text = DbManager.Instance.GameDbManager.GetGoalTypeById(item.Goal.GoalTypeId).Name; } else if (item.DbAttack.IsShotClockOverride) { text1.Text = "SCO"; text2.Text = ""; text3.Text = ""; text4.Text = ""; } else if (item.DbAttack.TurnoverPlayerId != null) { text1.Text = "TO"; text2.Text = dbPlayerManager.GetPlayerById(item.DbAttack.TurnoverPlayerId.Value).FirstName; text3.Text = ""; text4.Text = ""; } } else { if (childPosition >= item.Shots.Count) { text1.Text = "Rebound"; text2.Text = dbPlayerManager.GetPlayerById(item.Rebounds[childPosition - item.Shots.Count].PlayerId).FirstName; text3.Text = "Count: " + item.Rebounds[childPosition - item.Shots.Count].Count; } else { text1.Text = "Shot"; text2.Text = dbPlayerManager.GetPlayerById(item.Shots[childPosition].PlayerId).FirstName; text3.Text = "Count: " + item.Shots[childPosition].Count; } text4.Text = ""; } return(view); }
public string GetPlayerNameById(Guid playerId) { DbPlayer player = myPlayerDbManager.GetPlayerById(playerId); return(player.FirstName); }