Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OddsChangeEventArgs{T}"/> class
        /// </summary>
        /// <param name="messageMapper">A <see cref="IFeedMessageMapper"/> used to map feed message to the one dispatched to the user</param>
        /// <param name="feedMessage">A <see cref="bet_cancel"/> message received from the feed</param>
        /// <param name="cultures">A <see cref="IEnumerable{CultureInfo}"/> specifying the default languages to which the received message is translated</param>
        /// <param name="rawMessage">A raw message received from the feed</param>
        internal BetCancelEventArgs(IFeedMessageMapper messageMapper, bet_cancel feedMessage, IEnumerable <CultureInfo> cultures, byte[] rawMessage)
        {
            Guard.Argument(messageMapper, nameof(messageMapper)).NotNull();
            Guard.Argument(feedMessage, nameof(feedMessage)).NotNull();
            Guard.Argument(cultures, nameof(cultures)).NotNull().NotEmpty();

            _messageMapper   = messageMapper;
            _feedMessage     = feedMessage;
            _defaultCultures = cultures as IReadOnlyCollection <CultureInfo>;
            _rawMessage      = rawMessage;

            _betCancel = GetBetCancel();
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OddsChangeEventArgs{T}"/> class
        /// </summary>
        /// <param name="messageMapper">A <see cref="IFeedMessageMapper"/> used to map feed message to the one dispatched to the user</param>
        /// <param name="feedMessage">A <see cref="bet_cancel"/> message received from the feed</param>
        /// <param name="cultures">A <see cref="IEnumerable{CultureInfo}"/> specifying the default languages to which the received message is translated</param>
        /// <param name="rawMessage">A raw message received from the feed</param>
        internal BetCancelEventArgs(IFeedMessageMapper messageMapper, bet_cancel feedMessage, IEnumerable <CultureInfo> cultures, byte[] rawMessage)
        {
            Guard.Argument(messageMapper, nameof(messageMapper)).NotNull();
            Guard.Argument(feedMessage, nameof(feedMessage)).NotNull();
            if (!cultures.Any())
            {
                throw new ArgumentOutOfRangeException(nameof(cultures));
            }

            _messageMapper   = messageMapper;
            _feedMessage     = feedMessage;
            _defaultCultures = cultures as IReadOnlyCollection <CultureInfo>;
            _rawMessage      = rawMessage;

            _betCancel = GetBetCancel();
        }
Esempio n. 3
0
 public Anonymous(IBetCancel betCancel)
 {
     _id            = betCancel.BetId;
     _cancelPercent = betCancel.CancelPercent;
 }