/// <summary>
        /// Reads an instance of <see cref="Gu.Units.ElectricalConductance"/> from the <paramref name="reader"/>
        /// </summary>
        /// <param name="reader"></param>
        /// <returns>An instance of  <see cref="Gu.Units.ElectricalConductance"/></returns>
        public static ElectricalConductance ReadFrom(XmlReader reader)
        {
            var v = new ElectricalConductance();

            v.ReadXml(reader);
            return(v);
        }
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            var text = value as string;

            if (text != null)
            {
                return(ElectricalConductance.Parse(text, culture));
            }

            return(base.ConvertFrom(context, culture, value));
        }
Exemplo n.º 3
0
        public void ReadXml(XmlReader reader)
        {
            reader.MoveToContent();
            var attribute = reader.GetAttribute("Value");

            if (attribute is null)
            {
                throw new XmlException($"Could not find attribute named: Value");
            }

            this = new ElectricalConductance(XmlConvert.ToDouble(attribute), ElectricalConductanceUnit.Siemens);
            reader.ReadStartElement();
        }
Exemplo n.º 4
0
 /// <summary>
 /// Multiplies <paramref name="left"/> with <paramref name="right"/>
 /// </summary>
 /// <param name="left">The left value</param>
 /// <param name="right">The right value</param>
 /// <returns>The <see cref="ElectricalConductance"/> that is the result from the multiplication.</returns>
 public static ElectricalConductance operator *(Capacitance left, Frequency right)
 {
     return(ElectricalConductance.FromSiemens(left.farads * right.hertz));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Divides <paramref name="left"/> by <paramref name="right"/>
 /// </summary>
 /// <param name="left">The left value</param>
 /// <param name="right">The right value</param>
 /// <returns>The <see cref="ElectricalConductance"/> that is the result from the division.</returns>
 public static ElectricalConductance operator /(Capacitance left, Time right)
 {
     return(ElectricalConductance.FromSiemens(left.farads / right.seconds));
 }
Exemplo n.º 6
0
 public bool Equals(ElectricalConductance other, ElectricalConductance tolerance)
 {
     Ensure.GreaterThan(tolerance.siemens, 0, nameof(tolerance));
     return(Math.Abs(this.siemens - other.siemens) < tolerance.siemens);
 }
Exemplo n.º 7
0
 public bool Equals(ElectricalConductance other)
 {
     return(this.siemens.Equals(other.siemens));
 }
Exemplo n.º 8
0
 public int CompareTo(ElectricalConductance quantity)
 {
     return(this.siemens.CompareTo(quantity.siemens));
 }
Exemplo n.º 9
0
 public static bool TryParse(string text, NumberStyles styles, IFormatProvider provider, out ElectricalConductance result)
 {
     return(QuantityParser.TryParse <ElectricalConductanceUnit, ElectricalConductance>(text, From, styles, provider, out result));
 }
Exemplo n.º 10
0
 public static bool TryParse(string text, NumberStyles styles, out ElectricalConductance result)
 {
     return(QuantityParser.TryParse <ElectricalConductanceUnit, ElectricalConductance>(text, From, styles, CultureInfo.CurrentCulture, out result));
 }
Exemplo n.º 11
0
 public static ElectricalConductance operator /(Current left, Voltage right)
 {
     return(ElectricalConductance.FromSiemens(left.amperes / right.volts));
 }
Exemplo n.º 12
0
 /// <summary>
 /// Divides <paramref name="left"/> by <paramref name="right"/>
 /// </summary>
 /// <param name="left">The left value</param>
 /// <param name="right">The right value</param>
 /// <returns>The ElectricalConductance that is the result from the division.</returns>
 public static ElectricalConductance operator /(double left, Resistance right)
 {
     return(ElectricalConductance.FromSiemens(left / right.ohms));
 }
Exemplo n.º 13
0
 /// <summary>
 /// Divides <paramref name="left"/> by <paramref name="right"/>
 /// </summary>
 /// <param name="left">The left value</param>
 /// <param name="right">The right value</param>
 /// <returns>The <see cref="ElectricalConductance"/> that is the result from the division.</returns>
 public static ElectricalConductance operator /(Time left, Inductance right)
 {
     return(ElectricalConductance.FromSiemens(left.seconds / right.henrys));
 }
Exemplo n.º 14
0
 /// <summary>
 /// Divides <paramref name="left"/> by <paramref name="right"/>
 /// </summary>
 /// <param name="left">The left value</param>
 /// <param name="right">The right value</param>
 /// <returns>The <see cref="ElectricalConductance"/> that is the result from the division.</returns>
 public static ElectricalConductance operator /(Conductivity left, Wavenumber right)
 {
     return(ElectricalConductance.FromSiemens(left.siemensPerMetre / right.reciprocalMetres));
 }
Exemplo n.º 15
0
 /// <summary>
 /// Multiplies <paramref name="left"/> with <paramref name="right"/>
 /// </summary>
 /// <param name="left">The left value</param>
 /// <param name="right">The right value</param>
 /// <returns>The <see cref="ElectricalConductance"/> that is the result from the multiplication.</returns>
 public static ElectricalConductance operator *(Conductivity left, Length right)
 {
     return(ElectricalConductance.FromSiemens(left.siemensPerMetre * right.metres));
 }
 public static ElectricalConductance operator /(ElectricCharge left, MagneticFlux right)
 {
     return(ElectricalConductance.FromSiemens(left.coulombs / right.webers));
 }