/// <summary> /// Initializes a new instance of the <see cref="BetDetail"/> class /// </summary> /// <param name="betDetail">The bet detail</param> public BetDetail(Anonymous2 betDetail) { Guard.Argument(betDetail, nameof(betDetail)).NotNull(); BetId = betDetail.BetId; if (betDetail.Reason != null) { Reason = new ResponseReason(betDetail.Reason.Code, betDetail.Reason.Message); } if (betDetail.AlternativeStake != null && betDetail.AlternativeStake.Stake > 0) { AlternativeStake = new AlternativeStake(betDetail.AlternativeStake.Stake); } if (betDetail.SelectionDetails != null && betDetail.SelectionDetails.Any()) { SelectionDetails = betDetail.SelectionDetails.ToList().ConvertAll(s => new SelectionDetail(s.SelectionIndex, new ResponseReason(s.Reason.Code, s.Reason.Message), s.RejectionInfo == null ? null : new RejectionInfo(s.RejectionInfo.Id, s.RejectionInfo.EventId, s.RejectionInfo.Odds))); } if (betDetail.Reoffer != null && betDetail.Reoffer.Stake > 0) { Reoffer = new BetReoffer(betDetail.Reoffer.Stake, MtsTicketHelper.Convert(betDetail.Reoffer.Type)); } }
public void ScheduleCallback2(Anonymous2 fn, string str) { lock (this) { callbacks2.Add(new DelegateSrtArg() { Arg = str, Delegate = fn }); } }