public void DoLineScoreUpdate(object sender, LineScoreUpdateArgs args) { switch (args.UpdateType) { case LineScoreUpdateType.Name: if (args.Location == TeamLocation.Home) { lblHomename.Text = args.SValue; } else { lblVisitname.Text = args.SValue; } break; case LineScoreUpdateType.InningScore: UpdateInningScore(args.Inning, args.IValue, args.Location); break; case LineScoreUpdateType.CurrentScore: if (args.Location == TeamLocation.Visitor) { lblVisruns.Text = args.IValue.ToString(); } else { lblHomeruns.Text = args.IValue.ToString(); } break; case LineScoreUpdateType.CurrentHits: if (args.Location == TeamLocation.Visitor) { lblVishits.Text = args.IValue.ToString(); } else { lblHomehits.Text = args.IValue.ToString(); } break; case LineScoreUpdateType.CurrentErrors: if (args.Location == TeamLocation.Visitor) { lblViserrors.Text = args.IValue.ToString(); } else { lblHomeerrors.Text = args.IValue.ToString(); } break; case LineScoreUpdateType.Outs: lblOuts.Text = args.IValue.ToString(); break; case LineScoreUpdateType.Inning: lblInning.Text = args.Inning.ToString(); break; default: //better not get here break; } }
private void RaiseLineScoreUpdateEvent(LineScoreUpdateType updateType, int inning, int iValue, TeamLocation loc, string sValue) { if (LineScoreUpdate != null) { LineScoreUpdateArgs args = new LineScoreUpdateArgs(); args.UpdateType = updateType; args.SValue = sValue; args.Location = loc; args.Inning = inning; args.IValue = iValue; LineScoreUpdate(this, args); } }