Example #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Updates the text displayed in the spin box.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        protected override void UpdateEditText()
        {
            // Prevent validation while updating the text. Since we know what will be
            // set, there is no need to validate it.
            m_preventValidation = true;

            double valueToDisplay = m_fDisplayAbsoluteValues ? Math.Abs(m_mptValue) : m_mptValue;

            Text = MeasurementUtils.FormatMeasurement(valueToDisplay, m_measureType, UseVariablePrecision);
            m_preventValidation = false;
        }
Example #2
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Append information about a measure value
 /// </summary>
 /// <param name="text">text string to append to</param>
 /// <param name="measureLabel">Label identifying what this measurement represents</param>
 /// <param name="msrType">Type representing the measurement units to which the value
 /// should be converted and with which it should be shown.</param>
 /// <param name="value">measurement value (in millipoints) to write</param>
 /// ------------------------------------------------------------------------------------
 private void AppendMeasure(StringBuilder text, string measureLabel, MsrSysType msrType,
                            int value)
 {
     AppendItem(text, measureLabel, MeasurementUtils.FormatMeasurement(value, msrType));
 }