Beispiel #1
0
 /// <summary>
 /// Применяет введенные данные к стойкам шасси
 /// </summary>
 /// <param name="condition"></param>
 /// <param name="textN1"></param>
 /// <param name="textN2"></param>
 private void ApplyBundle(LandingGearCondition condition, TextBox textN1, TextBox textN2)
 {
     if (condition.LandingGear != null)
     {
         condition.TirePressure1 = UsefulMethods.StringToDouble(textN1.Text);
         condition.TirePressure2 = UsefulMethods.StringToDouble(textN2.Text);
     }
 }
        /*
         * Реализация
         */

        #region private void FillBundle(LandingGearCondition condition, Label labelTitle, TextBox textN1, TextBox textN2)
        /// <summary>
        /// Заполняет контролы для агрегата шасси
        /// </summary>
        /// <param name="title"></param>
        /// <param name="textN1"></param>
        /// <param name="textN2"></param>
        private void FillBundle(LandingGearCondition condition, Label labelTitle, TextBox textN1, TextBox textN2)
        {
            if (condition != null && condition.LandingGear != null)
            {
                labelTitle.Text = condition.LandingGear.LandingGearMark.ToString();
                textN1.Text     = condition.TirePressure1.ToString();
                textN2.Text     = condition.TirePressure2.ToString();
            }
            else
            {
                labelTitle.Text = textN1.Text = textN2.Text = "";
            }
        }
Beispiel #3
0
        /// <summary>
        /// Проверяет правильность введенных данных
        /// </summary>
        /// <param name="condition"></param>
        /// <param name="labelTitle"></param>
        /// <param name="textN1"></param>
        /// <param name="textN2"></param>
        /// <returns></returns>
        private bool ValidateBundle(LandingGearCondition condition, Label labelTitle, TextBox textN1, TextBox textN2)
        {
            double d;

            if (!UsefulMethods.StringToDouble(textN1.Text, out d))
            {
                SimpleBalloon.Show(textN1, ToolTipIcon.Warning, "Incorrect numeric format", "Enter valid number");

                return(false);
            }
            if (!UsefulMethods.StringToDouble(textN2.Text, out d))
            {
                SimpleBalloon.Show(textN2, ToolTipIcon.Warning, "Incorrect numeric format", "Enter valid number");

                return(false);
            }

            //
            return(true);
        }