Exemplo n.º 1
0
 protected void UpdatePinnedItems()
 {
     for (int i = 0; i < Exchange.PinnedTickers.Count; i++)
     {
         PinnedTickerInfo info = Exchange.PinnedTickers[i];
         Ticker           t    = Exchange.Tickers.FirstOrDefault(tt => tt.BaseCurrency == info.BaseCurrency && tt.MarketCurrency == info.MarketCurrency);
         if (t != null)
         {
             t.IsSelected = true;
         }
     }
 }
Exemplo n.º 2
0
        private void repositoryItemCheckEdit1_EditValueChanged(object sender, EventArgs e)
        {
            this.gvTikers.CloseEditor();
            Ticker ticker = (Ticker)this.gvTikers.GetFocusedRow();

            if (ticker.IsSelected)
            {
                Exchange.PinnedTickers.Add(new PinnedTickerInfo()
                {
                    BaseCurrency = ticker.BaseCurrency, MarketCurrency = ticker.MarketCurrency
                });
            }
            else
            {
                PinnedTickerInfo info = Exchange.PinnedTickers.FirstOrDefault(p => p.BaseCurrency == ticker.BaseCurrency && p.MarketCurrency == ticker.MarketCurrency);
                Exchange.PinnedTickers.Remove(info);
            }
        }
Exemplo n.º 3
0
 public Ticker GetTicker(PinnedTickerInfo info)
 {
     return(Tickers.FirstOrDefault(t => t.BaseCurrency == info.BaseCurrency && t.MarketCurrency == info.MarketCurrency));
 }