Exemple #1
0
        /// <summary>
        /// accept button
        /// кнопка принять
        /// </summary>
        private void ButtonAccept_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (Convert.ToInt32(TextBoxLenght.Text) <= 0)
                {
                    throw new Exception("error");
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Процесс сохранения прерван. В одном из полей недопустимые значения");
                return;
            }

            _trix.ColorBase = HostColorBase.Child.BackColor;
            _trix.Period    = Convert.ToInt32(TextBoxLenght.Text);
            _trix.PaintOn   = CheckBoxPaintOnOff.IsChecked.Value;

            Enum.TryParse(Movingbox.Text, out _trix.TypeCalculationAverage);

            _trix.Save();

            IsChange = true;
            Close();
        }