public string PressureUnitToString(PressureUnit unit) { return (_appContext.GetString(_appContext.Resources.GetIdentifier( unit.ToString(), ResourceType.String, _appContext.PackageName))); }
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; } } }
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(); } }
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()); } }
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)); }
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(); } }