示例#1
0
        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;
            }
        }
示例#2
0
        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);
            }
        }