Ejemplo n.º 1
0
		private void DepthClick(object sender, RoutedEventArgs e)
		{
			var connector = MainWindow.Instance.Connector;

			var window = _quotesWindows.SafeAdd(SecurityPicker.SelectedSecurity, security =>
			{
				// начинаем получать котировки стакана
				connector.RegisterMarketDepth(security);

				// создаем окно со стаканом
				var wnd = new QuotesWindow { Title = security.Id + " " + LocalizedStrings.MarketDepth };
				wnd.MakeHideable();
				return wnd;
			});

			if (window.Visibility == Visibility.Visible)
				window.Hide();
			else
				window.Show();

			if (!_initialized)
			{
				TraderOnMarketDepthsChanged(new[] { connector.GetMarketDepth(SecurityPicker.SelectedSecurity) });
				connector.MarketDepthsChanged += TraderOnMarketDepthsChanged;
				_initialized = true;
			}
		}
Ejemplo n.º 2
0
        private void DepthClick(object sender, RoutedEventArgs e)
        {
            var connector = MainWindow.Instance.Connector;

            foreach (var security in SecurityPicker.SelectedSecurities)
            {
                var window = _quotesWindows.SafeAdd(security, s =>
                {
                    // subscribe on order book flow
                    connector.RegisterMarketDepth(security);

                    // create order book window
                    var wnd = new QuotesWindow
                    {
                        Title = security.Id + " " + LocalizedStrings.MarketDepth
                    };
                    wnd.MakeHideable();
                    return(wnd);
                });

                if (window.Visibility == Visibility.Visible)
                {
                    window.Hide();
                }
                else
                {
                    window.Show();
                    window.DepthCtrl.UpdateDepth(connector.GetMarketDepth(security));
                }

                if (!_initialized)
                {
                    connector.MarketDepthChanged += TraderOnMarketDepthChanged;
                    _initialized = true;
                }
            }
        }
		private void DepthClick(object sender, RoutedEventArgs e)
		{
			var connector = MainWindow.Instance.Connector;

			var window = _quotesWindows.SafeAdd(SecurityPicker.SelectedSecurity, security =>
			{
				// subscribe on order book flow
				connector.RegisterMarketDepth(security);

				// create order book window
				var wnd = new QuotesWindow { Title = security.Id + " " + LocalizedStrings.MarketDepth };
				wnd.MakeHideable();
				return wnd;
			});

			if (window.Visibility == Visibility.Visible)
				window.Hide();
			else
				window.Show();

			if (!_initialized)
			{
				TraderOnMarketDepthsChanged(new[] { connector.GetMarketDepth(SecurityPicker.SelectedSecurity) });
				connector.MarketDepthsChanged += TraderOnMarketDepthsChanged;
				_initialized = true;
			}
		}