private void PubSub_OnPrediction(object sender, OnPredictionArgs e)
        {
            //if (e.Type == PredictionType.EventCreated)
            {
                _logger.Information($"A new prediction has started: {e.Title}");
            }

            //if (e.Type == PredictionType.EventUpdated)
            {
                if (e.Status == PredictionStatus.Active)
                {
                    var winningOutcome = e.Outcomes.First(x => e.WinningOutcomeId.Equals(x.Id));
                    _logger.Information($"Prediction: {e.Status}, {e.Title} => winning: {winningOutcome.Title}({winningOutcome.TotalPoints} points by {winningOutcome.TotalUsers} users)");
                }

                if (e.Status == PredictionStatus.Resolved)
                {
                    var winningOutcome = e.Outcomes.First(x => e.WinningOutcomeId.Equals(x.Id));
                    _logger.Information($"Prediction: {e.Status}, {e.Title} => Won: {winningOutcome.Title}({winningOutcome.TotalPoints} points by {winningOutcome.TotalUsers} users)");
                }
            }
        }
Esempio n. 2
0
 private void OnPubSubPrediction(object sender, OnPredictionArgs e)
 {
     MessageBox.Show(e.Title);
 }