public void DoLineupUpdate(object sender, LineupUpdateArgs args) { switch (args.RoleType) { case LineupRoleType.Pitcher: if (args.Location == TeamLocation.Home) { lblHomepitcher.Text = args.Name; } else { lblVispitcher.Text = args.Name; } break; case LineupRoleType.Batter: UpdateLineupName(args.SlotNumber, args.Name, args.Location); break; case LineupRoleType.Team: UpdateLineupName(args.SlotNumber, args.Name, args.Location); break; default: // shouldn't get here break; } }
private void RaiseLineupUpdateEvent(LineupRoleType roleType, int slotNumber, TeamLocation loc, string name) { if (LineupUpdate != null) { LineupUpdateArgs args = new LineupUpdateArgs(); args.RoleType = roleType; args.SlotNumber = slotNumber; args.Location = loc; args.Name = name; LineupUpdate(this, args); } }