Пример #1
0
        /// <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);
        }
Пример #2
0
        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));
        }
Пример #3
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 Stiffness that is the result from the division.</returns>
 public static Stiffness operator /(double left, Flexibility right)
 {
     return(Stiffness.FromNewtonsPerMetre(left / right.metresPerNewton));
 }
Пример #4
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="Stiffness"/> that is the result from the division.</returns>
 public static Stiffness operator /(Pressure left, Wavenumber right)
 {
     return(Stiffness.FromNewtonsPerMetre(left.pascals / right.reciprocalMetres));
 }
Пример #5
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="Stiffness"/> that is the result from the multiplication.</returns>
 public static Stiffness operator *(Pressure left, Length right)
 {
     return(Stiffness.FromNewtonsPerMetre(left.pascals * right.metres));
 }
Пример #6
0
 public static Stiffness operator *(Force left, Wavenumber right)
 {
     return(Stiffness.FromNewtonsPerMetre(left.newtons * right.reciprocalMetres));
 }
Пример #7
0
 public static Stiffness operator /(Force left, Length right)
 {
     return(Stiffness.FromNewtonsPerMetre(left.newtons / right.metres));
 }
Пример #8
0
 public static Stiffness operator *(double left, StiffnessUnit right)
 {
     return(Stiffness.From(left, right));
 }
Пример #9
0
 public static Stiffness operator *(MagneticFieldStrength left, Current right)
 {
     return(Stiffness.FromNewtonsPerMetre(left.teslas * right.amperes));
 }
Пример #10
0
 /// <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));
 }
Пример #11
0
 /// <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));
 }
Пример #12
0
 /// <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));
 }
Пример #13
0
 /// <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));
 }
Пример #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="Stiffness"/> that is the result from the division.</returns>
 public static Stiffness operator /(Power left, KinematicViscosity right)
 {
     return(Stiffness.FromNewtonsPerMetre(left.watts / right.squareMetresPerSecond));
 }
Пример #15
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="Stiffness"/> that is the result from the division.</returns>
 public static Stiffness operator /(MassFlow left, Time right)
 {
     return(Stiffness.FromNewtonsPerMetre(left.kilogramsPerSecond / right.seconds));
 }
Пример #16
0
 /// <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);
 }
Пример #17
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="Stiffness"/> that is the result from the multiplication.</returns>
 public static Stiffness operator *(MassFlow left, Frequency right)
 {
     return(Stiffness.FromNewtonsPerMetre(left.kilogramsPerSecond * right.hertz));
 }
Пример #18
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="Stiffness"/> that is the result from the multiplication.</returns>
 public static Stiffness operator *(AreaDensity left, SpecificEnergy right)
 {
     return(Stiffness.FromNewtonsPerMetre(left.kilogramsPerSquareMetre * right.joulesPerKilogram));
 }
Пример #19
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="Stiffness"/> that is the result from the division.</returns>
 public static Stiffness operator /(Energy left, Area right)
 {
     return(Stiffness.FromNewtonsPerMetre(left.joules / right.squareMetres));
 }
Пример #20
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="Stiffness"/> that is the result from the division.</returns>
 public static Stiffness operator /(ForcePerUnitless left, LengthPerUnitless right)
 {
     return(Stiffness.FromNewtonsPerMetre(left.newtonsPerUnitless / right.metresPerUnitless));
 }