/// <summary> /// Reads an instance of <see cref="Gu.Units.Stiffness"/> from the <paramref name="reader"/> /// </summary> /// <param name="reader"></param> /// <returns>An instance of <see cref="Gu.Units.Stiffness"/></returns> public static Stiffness ReadFrom(XmlReader reader) { var v = new Stiffness(); v.ReadXml(reader); return(v); }
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { var text = value as string; if (text != null) { return(Stiffness.Parse(text, culture)); } return(base.ConvertFrom(context, culture, value)); }
/// <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 Stiffness that is the result from the division.</returns> public static Stiffness operator /(double left, Flexibility right) { return(Stiffness.FromNewtonsPerMetre(left / right.metresPerNewton)); }
/// <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="Stiffness"/> that is the result from the division.</returns> public static Stiffness operator /(Pressure left, Wavenumber right) { return(Stiffness.FromNewtonsPerMetre(left.pascals / right.reciprocalMetres)); }
/// <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="Stiffness"/> that is the result from the multiplication.</returns> public static Stiffness operator *(Pressure left, Length right) { return(Stiffness.FromNewtonsPerMetre(left.pascals * right.metres)); }
public static Stiffness operator *(Force left, Wavenumber right) { return(Stiffness.FromNewtonsPerMetre(left.newtons * right.reciprocalMetres)); }
public static Stiffness operator /(Force left, Length right) { return(Stiffness.FromNewtonsPerMetre(left.newtons / right.metres)); }
public static Stiffness operator *(double left, StiffnessUnit right) { return(Stiffness.From(left, right)); }
public static Stiffness operator *(MagneticFieldStrength left, Current right) { return(Stiffness.FromNewtonsPerMetre(left.teslas * right.amperes)); }
/// <summary> /// Returns a quantity indicating whether this instance is equal to a specified <see cref="Gu.Units.Stiffness"/> object. /// </summary> /// <returns> /// true if <paramref name="other"/> represents the same Stiffness as this instance; otherwise, false. /// </returns> /// <param name="other">An instance of <see cref="Gu.Units.Stiffness"/> object to compare with this instance.</param> public bool Equals(Stiffness other) { return(this.newtonsPerMetre.Equals(other.newtonsPerMetre)); }
/// <summary> /// Compares this instance to a specified <see cref="Gu.Units.Stiffness"/> object and returns an integer that indicates whether this <paramref name="quantity"/> is smaller than, equal to, or greater than the <see cref="Gu.Units.Stiffness"/> object. /// </summary> /// <returns> /// A signed number indicating the relative quantitys of this instance and <paramref name="quantity"/>. /// /// Value /// /// Description /// /// A negative integer /// /// This instance is smaller than <paramref name="quantity"/>. /// /// Zero /// /// This instance is equal to <paramref name="quantity"/>. /// /// A positive integer /// /// This instance is larger than <paramref name="quantity"/>. /// /// </returns> /// <param name="quantity">An instance of <see cref="Gu.Units.Stiffness"/> object to compare to this instance.</param> public int CompareTo(Stiffness quantity) { return(this.newtonsPerMetre.CompareTo(quantity.newtonsPerMetre)); }
/// <summary> /// Creates an instance of <see cref="Gu.Units.Stiffness"/> from its string representation /// </summary> /// <param name="text">The string representation of the <see cref="Gu.Units.Stiffness"/></param> /// <param name="styles">Specifies the <see cref="NumberStyles"/> to be used.</param> /// <param name="provider">Specifies the formatProvider to be used.</param> /// <param name="result">The parsed <see cref="Stiffness"/></param> /// <returns>True if an instance of <see cref="Stiffness"/> could be parsed from <paramref name="text"/></returns> public static bool TryParse(string text, NumberStyles styles, IFormatProvider provider, out Stiffness result) { return(QuantityParser.TryParse <StiffnessUnit, Stiffness>(text, From, styles, provider, out result)); }
/// <summary> /// Creates an instance of <see cref="Gu.Units.Stiffness"/> from its string representation /// </summary> /// <param name="text">The string representation of the <see cref="Gu.Units.Stiffness"/></param> /// <param name="styles">Specifies the <see cref="NumberStyles"/> to be used.</param> /// <param name="result">The parsed <see cref="Stiffness"/></param> /// <returns>True if an instance of <see cref="Stiffness"/> could be parsed from <paramref name="text"/></returns> public static bool TryParse(string text, NumberStyles styles, out Stiffness result) { return(QuantityParser.TryParse <StiffnessUnit, Stiffness>(text, From, styles, CultureInfo.CurrentCulture, out result)); }
/// <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="Stiffness"/> that is the result from the division.</returns> public static Stiffness operator /(Power left, KinematicViscosity right) { return(Stiffness.FromNewtonsPerMetre(left.watts / right.squareMetresPerSecond)); }
/// <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="Stiffness"/> that is the result from the division.</returns> public static Stiffness operator /(MassFlow left, Time right) { return(Stiffness.FromNewtonsPerMetre(left.kilogramsPerSecond / right.seconds)); }
/// <summary> /// Returns a quantity indicating whether this instance is equal to a specified <see cref="Gu.Units.Stiffness"/> object within the given tolerance. /// </summary> /// <returns> /// true if <paramref name="other"/> represents the same Stiffness as this instance; otherwise, false. /// </returns> /// <param name="other">An instance of <see cref="Gu.Units.Stiffness"/> object to compare with this instance.</param> /// <param name="tolerance">The maximum difference for being considered equal. Must be greater than zero.</param> public bool Equals(Stiffness other, Stiffness tolerance) { Ensure.GreaterThan(tolerance.newtonsPerMetre, 0, nameof(tolerance)); return(Math.Abs(this.newtonsPerMetre - other.newtonsPerMetre) < tolerance.newtonsPerMetre); }
/// <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="Stiffness"/> that is the result from the multiplication.</returns> public static Stiffness operator *(MassFlow left, Frequency right) { return(Stiffness.FromNewtonsPerMetre(left.kilogramsPerSecond * right.hertz)); }
/// <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="Stiffness"/> that is the result from the multiplication.</returns> public static Stiffness operator *(AreaDensity left, SpecificEnergy right) { return(Stiffness.FromNewtonsPerMetre(left.kilogramsPerSquareMetre * right.joulesPerKilogram)); }
/// <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="Stiffness"/> that is the result from the division.</returns> public static Stiffness operator /(Energy left, Area right) { return(Stiffness.FromNewtonsPerMetre(left.joules / right.squareMetres)); }
/// <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="Stiffness"/> that is the result from the division.</returns> public static Stiffness operator /(ForcePerUnitless left, LengthPerUnitless right) { return(Stiffness.FromNewtonsPerMetre(left.newtonsPerUnitless / right.metresPerUnitless)); }