Exemplo n.º 1
0
        /// <summary>
        /// set new active tab /
        /// установить новую активную вкладку
        /// </summary>
        private void ChangeActivTab(int tabNumber)
        {
            try
            {
                if (!_isPainting)
                {
                    return;
                }

                if (!_tabBotTab.Dispatcher.CheckAccess())
                {
                    _tabBotTab.Dispatcher.Invoke(new Action <int>(ChangeActivTab), tabNumber);
                    return;
                }
                if (ActivTab != null)
                {
                    ActivTab.StopPaint();
                }

                if (_botTabs == null ||
                    _botTabs.Count <= tabNumber)
                {
                    return;
                }

                ActivTab = _botTabs[tabNumber];

                if (ActivTab.GetType().Name == "BotTabSimple")
                {
                    ((BotTabSimple)ActivTab).StartPaint(_gridChart, _hostChart, _hostGlass, _hostOpenDeals, _hostCloseDeals,
                                                        _rectangle, _hostAlerts, _textBoxLimitPrice, _gridChartControlPanel);
                }
                else if (ActivTab.GetType().Name == "BotTabIndex")
                {
                    ((BotTabIndex)ActivTab).StartPaint(_gridChart, _hostChart, _rectangle);
                }
                else if (ActivTab.GetType().Name == "BotTabCluster")
                {
                    ((BotTabCluster)ActivTab).StartPaint(_hostChart, _rectangle);
                }
            }
            catch (Exception error)
            {
                SendNewLogMessage(error.ToString(), LogMessageType.Error);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// убрать все вкладки
        /// </summary>
        public void ClearTabs()
        {
            for (int i = 0; TabsSimple != null && i < TabsSimple.Count; i++)
            {
                TabsSimple[i].Clear();
            }
            for (int i = 0; TabsIndex != null && i < TabsIndex.Count; i++)
            {
                TabsIndex[i].Clear();
            }
            for (int i = 0; TabsCluster != null && i < TabsCluster.Count; i++)
            {
                TabsCluster[i].Clear();
            }

            if (_botTabs != null)
            {
                _botTabs.Clear();
            }

            ActivTab = null;
        }