示例#1
0
        /// <summary>
        /// check if alert is currently being edited
        /// проверить, не редактируется ли сейчас Алерт
        /// </summary>
        private void CheckAlert()
        {
            try
            {
                if (_alertChartUi == null)
                {
                    return;
                }

                int     numberCandle = 0;
                decimal pricePoint;
                // crutch does not always help
                // костыль не всегда помогает
                try
                {
                    ChartArea candleArea = _chartMaster.GetChartArea("Prime");

                    numberCandle = Convert.ToInt32(candleArea.CursorX.Position);
                    pricePoint   = Convert.ToDecimal(candleArea.CursorY.Position);
                    candleArea.CursorY.Position = double.NaN;
                }
                catch (Exception)
                {
                    return;
                    // ignore
                }

                _alertChartUi.SetFormChart(_connector.Candles(false), numberCandle, pricePoint);
            }
            catch (Exception error)
            {
                SendNewMessage(error.ToString(), LogMessageType.Error);
            }
        }
示例#2
0
        /// <summary>
        /// check if alert is currently being edited
        /// проверить, не редактируется ли сейчас Алерт
        /// </summary>
        private void CheckAlert()
        {
            try
            {
                if (_alertChartUi == null)
                {
                    return;
                }

                int     numberCandle = 0;
                decimal pricePoint;
                // crutch does not always help
                // костыль не всегда помогает
                try
                {
                    numberCandle = _chartMaster.GetSelectCandleNumber();
                    pricePoint   = _chartMaster.GetCursorSelectPrice();
                    _chartMaster.RemoveCursor();
                }
                catch (Exception)
                {
                    return;
                    // ignore
                }

                _alertChartUi.SetFormChart(_connector.Candles(false), numberCandle, pricePoint);
            }
            catch (Exception error)
            {
                SendNewMessage(error.ToString(), LogMessageType.Error);
            }
        }