Пример #1
0
        public frmMarketView(BFBot.Market market)
        {
            InitializeComponent();
            ctrlMarket marketControl = new ctrlMarket(market);

            marketControl.Dock = DockStyle.Fill;
            this.Controls.Add(marketControl);
        }
Пример #2
0
 public ctrlMarket(BFBot.Market market)
 {
     InitializeComponent();
     m_market = market;
     foreach (BFBot.MarketItem marketItem in m_market.Runners)
     {
         ctrlMarketItem controlMarketItem = new ctrlMarketItem(marketItem);
         this.flowLayoutPanel1.Controls.Add(controlMarketItem);
     }
 }
Пример #3
0
 void m_market_OnMarketInPlay(BFBot.Market market)
 {
     if (groupBoxRaceDetails.InvokeRequired)
     {
         groupBoxRaceDetails.Invoke(new delegateChangeBackgroundColor(ChangeBackgroundColor), groupBoxRaceDetails, Color.LightSeaGreen);
     }
     else
     {
         groupBoxRaceDetails.BackColor = Color.LightSeaGreen;
     }
 }
Пример #4
0
 void m_marketTracker_OnMarketAdded(BFBot.Market market)
 {
     try
     {
         AddMarket(market);
     }
     catch (Exception ex)
     {
         AddMarket(market);
     }
 }
Пример #5
0
 public void AddMarket(BFBot.Market market)
 {
     if (!listViewActiveMarkets1.Items.Contains(market.GetMarketViewItem))
     {
         listViewActiveMarkets1.Items.Add(market.GetMarketViewItem);
         market.OnMarketClosed    += new BFBot.Market.MarketClosed(market_OnMarketClosed);
         market.OnMarketBacked    += new BFBot.Market.MarketBackedDelegate(market_OnMarketBacked);
         market.OnMarketEqualised += new BFBot.Market.MarketEqualisedDelegate(market_OnMarketEqualised);
         market.OnUpdateMarket    += new BFBot.Market.MarketUpdateDelegate(market_OnUpdateMarket);
     }
 }
Пример #6
0
        private void detailsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ListView.SelectedListViewItemCollection col = listViewActiveMarkets1.SelectedItems;

            ListViewItem item = col[0];

            BFBot.Market selectedMarket = item.Tag as BFBot.Market;

            frmMarketView marketView = new frmMarketView(selectedMarket);

            marketView.Show();
        }
Пример #7
0
        void market_OnMarketClosed(BFBot.Market market)
        {
            listViewActiveMarkets1.Items.Remove(market.GetMarketViewItem);
            while (listViewActiveMarkets1.Items.Contains(market.GetMarketViewItem))
            {
            }
            ListViewItem closedItem = new ListViewItem(market.MarketID, 4);

            closedItem.Tag = market;
            listViewClosedMarkets.Items.Add(closedItem);
            BFBotDB.BFBotDBWorker.Instance().CloseMarket(market.MarketGUID);
        }
Пример #8
0
        public frmMarketDetails()
        {
            System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
            InitializeComponent();
            if (m_marketTracker == null)
            {
                m_marketTracker = BFBot.MarketTracker.Instance;
                m_marketTracker.OnMarketAdded += new BFBot.MarketTracker.MarketAdded(m_marketTracker_OnMarketAdded);
                m_activeMarkets = BFBot.MarketTracker.Instance.ActiveMarkets();
            }
            timer1.Interval = 10000;

            //m_marketsToBeMoved = new List<BFBot.Market>();

            listViewActiveMarkets1.Columns.Add("Meeting");
            listViewActiveMarkets1.Columns.Add("Market Date");
            listViewActiveMarkets1.Columns.Add("Market Close");
            listViewActiveMarkets1.Columns.Add("Seconds To Off");
            listViewActiveMarkets1.Columns.Add("Back Stake");
            listViewActiveMarkets1.Columns.Add("Back Price");
            listViewActiveMarkets1.Columns.Add("Selection");
            listViewActiveMarkets1.Columns.Add("Lay Stake");
            listViewActiveMarkets1.Columns.Add("Lay Price");

            listViewActiveMarkets1.Visible = true;
            foreach (System.Collections.DictionaryEntry entry in m_activeMarkets)
            {
                BFBot.Market market = (BFBot.Market)entry.Value;
                AddMarket(market);
            }

            List <BFBotDB.DBClosedMarket> closedMarkets = BFBotDB.BFBotDBWorker.Instance().GetClosedMarkets();

            foreach (BFBotDB.DBClosedMarket closedMarket in closedMarkets)
            {
                //m_closedMarkets.Add(marketName);
                ListViewItem listViewItem = new ListViewItem(closedMarket.Name + "-" + closedMarket.Date + "-" + closedMarket.Time, 4);

                listViewClosedMarkets.Items.Add(listViewItem);
            }


            timer1.Start();
        }
Пример #9
0
        public MarketViewer(BFBot.Market market)
        {
            InitializeComponent();
            m_market = market;

            m_market.OnMarketBacked    += new BFBot.Market.MarketBackedDelegate(m_market_OnMarketBacked);
            m_market.OnMarketClosed    += new BFBot.Market.MarketClosed(m_market_OnMarketClosed);
            m_market.OnMarketEqualised += new BFBot.Market.MarketEqualisedDelegate(m_market_OnMarketEqualised);
            m_market.OnUpdateMarket    += new BFBot.Market.MarketUpdateDelegate(m_market_OnUpdateMarket);
            m_market.OnMarketInPlay    += new BFBot.Market.MarketInPlayAlert(m_market_OnMarketInPlay);

            UpdateMarketDetails();

            foreach (BFBot.MarketItem marketItem in m_market.GetMarketItems().Values)
            {
                flowLayoutPanel1.Controls.Add(new MarketItemControl(marketItem));
            }
            m_market.MarketUpdateTimer();
        }
Пример #10
0
        private void detailsToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            ClosedMarketDetails closedMarketDetails;

            ListView.SelectedListViewItemCollection col = listViewClosedMarkets.SelectedItems;

            ListViewItem item = col[0];

            BFBot.Market selectedMarket = item.Tag as BFBot.Market;

            //BFBot.MarketViewItem selectedMarketViewItem = col[0] as BFBot.MarketViewItem;
            if (selectedMarket != null)
            {
                closedMarketDetails = new ClosedMarketDetails(selectedMarket.MarketGUID);
            }
            else
            {
                string[] items = item.Text.Split('-');
                closedMarketDetails = new ClosedMarketDetails(items[0], items[1], items[2]);
            }
            closedMarketDetails.ShowDialog();
        }
Пример #11
0
 void market_OnMarketClosed(BFBot.Market market)
 {
     listBoxMarkets.Items.RemoveAt(listBoxMarkets.Items.IndexOf(market.RaceDescription() + "  @  " + market.MarketID));
     //throw new Exception("The method or operation is not implemented.");
 }
Пример #12
0
 void m_market_OnMarketBacked(BFBot.Market market)
 {
     //groupBoxRaceDetails.BackColor = Color.Green;
     //throw new Exception("The method or operation is not implemented.");
 }
Пример #13
0
 void m_market_OnMarketClosed(BFBot.Market market)
 {
     //this.Enabled = false;
     //throw new Exception("The method or operation is not implemented.");
 }
Пример #14
0
 void m_market_OnMarketEqualised(BFBot.Market market)
 {
     //throw new Exception("The method or operation is not implemented.");
 }
Пример #15
0
 void m_market_OnUpdateMarket(BFBot.Market market)
 {
     UpdateMarketDetails();
 }
Пример #16
0
 void market_OnUpdateMarket(BFBot.Market market)
 {
 }
Пример #17
0
 void market_OnMarketBacked(BFBot.Market market)
 {
     ChangeMarketIcon(market.Name, 1);
 }
Пример #18
0
 void market_OnMarketEqualised(BFBot.Market market)
 {
     ChangeMarketIcon(market.Name, 2);
 }