Ejemplo n.º 1
0
 public string PressureUnitToString(PressureUnit unit)
 {
     return
         (_appContext.GetString(_appContext.Resources.GetIdentifier(
                                    unit.ToString(), ResourceType.String,
                                    _appContext.PackageName)));
 }
Ejemplo n.º 2
0
        private void SetCfdUnit(PressureUnit unitToSet)
        {
            var unitToFind = unitToSet.ToString();

            for (var index = 0; index < cbCFDUnits.Items.Count; index++)
            {
                var unitFound = cbCFDUnits.Items[index].ToString();
                if (unitFound == unitToFind)
                {
                    cbCFDUnits.SelectedIndex = index;
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        private void ddPressure_OnSelectedIndexChange(object sender, EventArgs e)
        {
            if (ddPressure.SelectedItem != null)
            {
                var newUnit = UnitParser.ParsePressureUnit((string)ddPressure.SelectedItem);
                _mPressureValue = ddPressure.ConvertValue(_mActivePressureUnit, newUnit, _mPressureValue);
                if (!double.IsNaN(_mPressureValue))
                {
                    tbPressure.Text = Parsing.DoubleToString(_mPressureValue);
                }

                _mActivePressureUnit            = newUnit;
                Settings.Default.TMPressureUnit = _mActivePressureUnit.ToString();
            }
        }
Ejemplo n.º 4
0
        public static string GetFriendlyName(PressureUnit unit)
        {
            switch (unit)
            {
            case PressureUnit.InchOfMercury: return("inHg");

            case PressureUnit.KiloPascals: return("kPa");

            case PressureUnit.Pascals: return("Pa");

            case PressureUnit.Millibar: return("hPa");           //"mBar";

            default: return(unit.ToString());
            }
        }
Ejemplo n.º 5
0
        public string ToString(CultureInfo ci)
        {
            string tz;

            if (UseLocalTime)
            {
                tz = WxDateUnit.TimeZoneName(true, 0);
            }
            else
            {
                tz = UtcOffset.ToString(ci);
            }
            string sep = ci.TextInfo.ListSeparator;

            return(string.Format(CultureInfo.InvariantCulture,
                                 "{0}{8}{1}{8}{2}{8}{3}{8}{4}{8}{5}{8}{6}{8}{7}",
                                 tz, Temperature.ToString(),
                                 TemperatureRate.ToString(),
                                 Pressure.ToString(), Wind.ToString(),
                                 Rain.ToString(), RainRate.ToString(),
                                 "", sep));
        }
Ejemplo n.º 6
0
 public static string GetFriendlyName(PressureUnit unit)
 {
     switch (unit) {
     case PressureUnit.InchOfMercury: return "inHg";
     case PressureUnit.KiloPascals: return "kPa";
     case PressureUnit.Pascals: return "Pa";
     case PressureUnit.Millibar: return "hPa";//"mBar";
     default: return unit.ToString();
     }
 }