Example #1
0
        /// <summary>
        /// OnLoaded
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnLoaded(object sender, EventArgs e)
        {
            bfexplorerService.UiApplication = new JayBeeBotHost(SynchronizationContext.Current);

            bets = new MyBindingList <Bet>(this);

            foreach (var botDescriptor in bfexplorerService.BotManager.MyBots)
            {
                int botId = botDescriptor.BotId.Id;

                if (botId <= 9 || botId == 22)
                {
                    botDescriptor.Parameters.Name = botDescriptor.BotId.Name;
                    myBots.Add(botDescriptor);
                }
            }

            bindingSourceRaces.DataSource      = races;
            bindingSourceSelections.DataSource = selections;
            bindingSourceBets.DataSource       = bets;

            listBoxBotsToExecute.DataSource = myBots;

            var outputMessages = new MyBindingList <OutputMessage>(this);

            outputMessages.Attach(bfexplorerService.ServiceStatus.OutputMessages);

            dataGridViewOutput.DataSource = new BindingSource {
                DataSource = outputMessages
            };
        }
Example #2
0
        /// <summary>
        /// PopulateRaceData
        /// </summary>
        /// <param name="race"></param>
        private void PopulateRaceData(Race race)
        {
            if (selections.Count > 0)
            {
                selections.Clear();
            }

            foreach (var selection in race.Market.Selections)
            {
                if (selection.Status != SelectionStatus.Removed)
                {
                    selections.Add(selection);
                }
            }

            if (selectedRace != null)
            {
                bets.Dettach(selectedRace.Market.Bets);
            }

            bets.Attach(race.Market.Bets);

            labelMarket.Text = race.Market.MarketFullName;

            selectedRace = race;
        }