Example #1
0
        private void InitializeLimit()
        {
            var item1 = UITreeHelper.GetAll <SpeedInputer>(this.container, "Speed");

            foreach (var m in item1)
            {
                m.MaxValue = Constants.MaxSpeed;
                m.MinValue = Constants.MinSpeed;
            }

            var item2 = UITreeHelper.GetAll <AccelerationInputer>(this.container, "Acceleration");

            foreach (var m in item2)
            {
                m.MaxValue = Constants.MaxAcceleration;
                m.MinValue = Constants.MinAcceleration;
            }

            var item3 = UITreeHelper.GetAll <TimeInputer>(this.container, "Time");

            foreach (var m in item3)
            {
                m.MaxValue = Constants.MaxTime;
                m.MinValue = Constants.MinTime;
            }

            var item4 = UITreeHelper.GetAll <PressureInputer>(this.container, "Pressure");

            foreach (var m in item4)
            {
                m.MaxValue = Constants.MaxPressure;
                m.MinValue = Constants.MinPressure;
            }
        }
Example #2
0
 private void OnAccelerationUnitChanged(UnitAcceleratedTypes accelerationUnit)
 {
     UITreeHelper.ChangeLabelText(UITreeHelper.GetAll <LabelControl>(this.container, "Acceleration"), accelerationUnit.GetDescription());
     unitChangedHandler.Invoke();
     foreach (var m in UITreeHelper.GetAll <AccelerationInputer>(this.container, "Acceleration"))
     {
         m.UpdateUnitType(accelerationUnit);
         if (!string.IsNullOrEmpty(m.Suffix))
         {
             m.Suffix = accelerationUnit.GetDescription();
         }
     }
 }
Example #3
0
 private void OnPressureUnitChanged(UnitPressureTypes pressureUnit)
 {
     UITreeHelper.ChangeLabelText(UITreeHelper.GetAll <LabelControl>(this.container, "Pressure"), pressureUnit.GetDescription());
     unitChangedHandler.Invoke();
     foreach (var m in UITreeHelper.GetAll <PressureInputer>(this.container, "Pressure"))
     {
         m.UpdateUnitType(pressureUnit);
         if (!string.IsNullOrEmpty(m.Suffix))
         {
             m.Suffix = pressureUnit.GetDescription();
         }
     }
 }
Example #4
0
 private void OnSpeedUnitChanged(UnitSpeedTypes speedUnit)
 {
     UITreeHelper.ChangeLabelText(UITreeHelper.GetAll <LabelControl>(this.container, "Speed"), speedUnit.GetDescription());
     unitChangedHandler.Invoke();
     foreach (var m in UITreeHelper.GetAll <SpeedInputer>(this.container, "Speed"))
     {
         m.UpdateUnitType(speedUnit);
         if (!string.IsNullOrEmpty(m.Suffix))
         {
             m.Suffix = speedUnit.GetDescription();
         }
     }
 }