Exemple #1
0
        public void UpdateMarket()
        {
            List <MarketInformation> marketBook = modelCore.GetMarketBook(new List <string> {
                MarketId
            });

            MarketBookInformation recordJustReceived = marketBook[0].Mbi.Last();

            recordJustReceived.MarketName = MarketName; //проброс MarketName в MarketBookInformation при добавлении новых рыночных данных

            //добавляем только в том случае, если полученные данные отличаются от уже полученных ранее
            if (Mbi.LastOrDefault() != recordJustReceived)
            {
                Mbi.Add(recordJustReceived);
                //MessageBox.Show("Дык!");
            }
        }
Exemple #2
0
        public MarketInformation()
        {
            _mbi = new ObservableCollection <MarketBookInformation>();

            MarketBookInformation mbi = new MarketBookInformation()
            {
                MarketName  = this.MarketName,
                Runner0Name = this.Runner0Name,
                Runner1Name = this.Runner1Name,

                ExPricesRunner0 = new ExchangePrices()
                {
                    AvailableToBack = new ObservableCollection <PriceSize> {
                        new PriceSize(), new PriceSize(), new PriceSize()
                    },
                    AvailableToLay = new ObservableCollection <PriceSize> {
                        new PriceSize(), new PriceSize(), new PriceSize()
                    }
                },

                ExPricesRunner1 = new ExchangePrices()
                {
                    AvailableToBack = new ObservableCollection <PriceSize> {
                        new PriceSize(), new PriceSize(), new PriceSize()
                    },
                    AvailableToLay = new ObservableCollection <PriceSize> {
                        new PriceSize(), new PriceSize(), new PriceSize()
                    }
                }
            };

            Mbi.Add(mbi);

            //обработчик изменений внутри Mdi
            _mbiChangeHandler     = (sender, e) => OnPropertyChanged("Mbi");
            _mbiChangeItemHandler = (sender, e) => OnPropertyChanged("Mbi");
        }