Example #1
0
 /// <summary>
 /// Returns a quantity indicating whether this instance is equal to a specified <see cref="Gu.Units.AccelerationUnit"/> object.
 /// </summary>
 /// <param name="other">An instance of <see cref="Gu.Units.AccelerationUnit"/> object to compare with this instance.</param>
 /// <returns>
 /// true if <paramref name="other"/> represents the same AccelerationUnit as this instance; otherwise, false.
 /// </returns>
 public bool Equals(AccelerationUnit other)
 {
     return(this.symbol == other.symbol);
 }
Example #2
0
 /// <summary>
 /// Creates an instance of <see cref="Gu.Units.AccelerationUnit"/> from its string representation
 /// </summary>
 /// <param name="text">The string representation of the <see cref="Gu.Units.AccelerationUnit"/></param>
 /// <param name="result">The parsed <see cref="AccelerationUnit"/></param>
 /// <returns>True if an instance of <see cref="AccelerationUnit"/> could be parsed from <paramref name="text"/></returns>
 public static bool TryParse(string text, out AccelerationUnit result)
 {
     return(UnitParser <AccelerationUnit> .TryParse(text, out result));
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of <see cref="T:Gu.Units.Acceleration"/>.
 /// </summary>
 /// <param name="value"></param>
 /// <param name="unit"><see cref="T:Gu.Units.MetresPerSecondSquared"/>.</param>
 public Acceleration(double value, AccelerationUnit unit)
 {
     this.metresPerSecondSquared = unit.ToSiUnit(value);
 }
Example #4
0
        public string ToString(string format, IFormatProvider formatProvider, AccelerationUnit unit)
        {
            var quantity = unit.FromSiUnit(this.metresPerSecondSquared);

            return(string.Format("{0}{1}", quantity.ToString(format, formatProvider), unit.Symbol));
        }
Example #5
0
 /// <summary>
 /// Creates a new instance of <see cref="T:Gu.Units.Acceleration"/>.
 /// </summary>
 /// <param name="value"></param>
 /// <param name="unit"></param>
 public static Acceleration From(double value, AccelerationUnit unit)
 {
     return(new Acceleration(unit.ToSiUnit(value)));
 }