Exemple #1
0
        /// <summary>
        /// call up old alert settings by number
        /// вызвать насройки старого алерта по номеру
        /// </summary>
        /// <param name="number">номер</param>
        public void ShowAlertRedactDialog(int number)
        {
            try
            {
                if (_alertChartUi != null)
                {
                    MessageBox.Show(OsLocalization.Alerts.Message1);
                    return;
                }


                if (number > _alertArray.Count || _alertArray.Count == 0)
                {
                    return;
                }
                if (_alertArray[number].TypeAlert == AlertType.ChartAlert)
                {
                    _alertChartUi          = new AlertToChartCreateUi((AlertToChart)_alertArray[number], this);
                    _alertChartUi.Closing += _ChartAertUi_Closing;
                    _alertChartUi.Show();
                }
                if (_alertArray[number].TypeAlert == AlertType.PriceAlert)
                {
                    ((AlertToPrice)_alertArray[number]).ShowDialog();
                }
            }
            catch (Exception error)
            {
                SendNewMessage(error.ToString(), LogMessageType.Error);
            }
        }
Exemple #2
0
 /// <summary>
 /// alert settings window close
 /// закрывается окно настроек Алерта
 /// </summary>
 void _ChartAertUi_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     try
     {
         if (_alertChartUi.NeadToSave == false)
         {
             Delete(_alertChartUi.MyAlert);
         }
     }
     catch (Exception error)
     {
         SendNewMessage(error.ToString(), LogMessageType.Error);
     }
     finally
     {
         _alertChartUi = null;
     }
 }
Exemple #3
0
        /// <summary>
        /// create new Alert
        /// вызвать создание нового Алерта
        /// </summary>
        public void ShowAlertNewDialog(AlertType type)
        {
            try
            {
                if (type == AlertType.ChartAlert)
                {
                    if (_alertChartUi != null)
                    {
                        MessageBox.Show(OsLocalization.Alerts.Message1);
                        return;
                    }

                    _alertChartUi = new AlertToChartCreateUi(null, this);

                    if (_alertChartUi != null)
                    {
                        _alertChartUi.Closing += _ChartAertUi_Closing;
                        _alertChartUi.Show();
                    }
                }

                if (type == AlertType.PriceAlert)
                {
                    int num = 0;

                    if (_alertArray != null)
                    {
                        num = _alertArray.Count;
                    }

                    AlertToPrice newPriceAlert = new AlertToPrice(_name + num);

                    newPriceAlert.ShowDialog();

                    SetNewAlert(newPriceAlert);
                }
            }
            catch (Exception error)
            {
                SendNewMessage(error.ToString(), LogMessageType.Error);
            }
        }