コード例 #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (Convert.ToDecimal(TextBoxVolumeOne.Text) <= 0 ||
                    Convert.ToDecimal(TextBoxVolumeTwo.Text) <= 0 ||
                    Convert.ToInt32(Spread.Text) <= 0
                    )
                {
                    throw new Exception("");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("В одном из полей недопустимые значения. Процесс сохранения прерван");
                return;
            }

            _strategy.Volume1   = Convert.ToDecimal(TextBoxVolumeOne.Text);
            _strategy.Volume2   = Convert.ToDecimal(TextBoxVolumeTwo.Text);
            _strategy.RsiSpread = Convert.ToInt32(Spread.Text);



            _strategy.Save();
            Close();
        }
コード例 #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (Convert.ToDecimal(TextBoxVolumeOne.Text) <= 0 ||
                    Convert.ToDecimal(TextBoxVolumeTwo.Text) <= 0 ||
                    Convert.ToInt32(Spread.Text) <= 0
                    )
                {
                    throw new Exception("");
                }
            }
            catch (Exception)
            {
                MessageBox.Show(OsLocalization.Trader.Label13);
                return;
            }

            _strategy.Volume1   = Convert.ToDecimal(TextBoxVolumeOne.Text);
            _strategy.Volume2   = Convert.ToDecimal(TextBoxVolumeTwo.Text);
            _strategy.RsiSpread = Convert.ToInt32(Spread.Text);

            _strategy.Save();
            Close();
        }