protected void ToString(List <string> toStringOutput)
 {
     toStringOutput.Add($"CustomUnit = {(CustomUnit == null ? "null" : CustomUnit.ToString())}");
     toStringOutput.Add($"AreaUnit = {(AreaUnit == null ? "null" : AreaUnit.ToString())}");
     toStringOutput.Add($"LengthUnit = {(LengthUnit == null ? "null" : LengthUnit.ToString())}");
     toStringOutput.Add($"VolumeUnit = {(VolumeUnit == null ? "null" : VolumeUnit.ToString())}");
     toStringOutput.Add($"WeightUnit = {(WeightUnit == null ? "null" : WeightUnit.ToString())}");
     toStringOutput.Add($"GenericUnit = {(GenericUnit == null ? "null" : GenericUnit.ToString())}");
     toStringOutput.Add($"TimeUnit = {(TimeUnit == null ? "null" : TimeUnit.ToString())}");
     toStringOutput.Add($"Type = {(Type == null ? "null" : Type.ToString())}");
 }
Example #2
0
        private void ddVolume_OnSelectedIndexChange(object sender, EventArgs e)
        {
            if (ddTankVolume.SelectedItem != null)
            {
                var newUnit = UnitParser.ParseVolumeUnit((string)ddTankVolume.SelectedItem);

                _mVolumeValue = ddTankVolume.ConvertValue(_mActiveVolumeUnit, newUnit, _mVolumeValue);
                if (!double.IsNaN(_mVolumeValue))
                {
                    tbVolume.Text = Parsing.DoubleToString(_mVolumeValue);
                }

                _mActiveVolumeUnit            = newUnit;
                Settings.Default.TMVolumeUnit = _mActiveVolumeUnit.ToString();
            }
        }