Ejemplo n.º 1
0
 public static bool TryParse(string?str, IFormatProvider?provider, out AbsorbedDose result)
 {
     return(QuantityParser.Default.TryParse <AbsorbedDose, AbsorbedDoseUnit>(
                str,
                provider,
                From,
                out result));
 }
Ejemplo n.º 2
0
        public bool Equals(AbsorbedDose other, double tolerance, ComparisonType comparisonType)
        {
            if (tolerance < 0)
            {
                throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0.");
            }

            double thisValue             = (double)this.Value;
            double otherValueInThisUnits = other.As(this.Unit);

            return(UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType));
        }
Ejemplo n.º 3
0
 public bool Equals(AbsorbedDose other)
 {
     return(_value.Equals(other.GetValueAs(this.Unit)));
 }
Ejemplo n.º 4
0
 public int CompareTo(AbsorbedDose other)
 {
     return(_value.CompareTo(other.GetValueAs(this.Unit)));
 }
Ejemplo n.º 5
0
 public static bool TryParse(string?str, out AbsorbedDose result)
 {
     return(TryParse(str, null, out result));
 }
Ejemplo n.º 6
0
 public bool Equals(AbsorbedDose other)
 {
     return(_value.Equals(other.AsBaseNumericType(this.Unit)));
 }
Ejemplo n.º 7
0
 // Windows Runtime Component does not allow public methods/ctors with same number of parameters: https://msdn.microsoft.com/en-us/library/br230301.aspx#Overloaded methods
 internal int CompareTo(AbsorbedDose other)
 {
     return(_value.CompareTo(other.AsBaseNumericType(this.Unit)));
 }
Ejemplo n.º 8
0
        /// <summary>
        ///     Try to parse a string with one or two quantities of the format "&lt;quantity&gt; &lt;unit&gt;".
        /// </summary>
        /// <param name="str">String to parse. Typically in the form: {number} {unit}</param>
        /// <param name="result">Resulting unit quantity if successful.</param>
        /// <returns>True if successful, otherwise false.</returns>
        /// <example>
        ///     Length.Parse("5.5 m", new CultureInfo("en-US"));
        /// </example>
        /// <param name="cultureName">Name of culture (ex: "en-US") to use when parsing number and unit. Defaults to <see cref="GlobalConfiguration.DefaultCulture" /> if null.</param>
        public static bool TryParse([CanBeNull] string str, [CanBeNull] string cultureName, out AbsorbedDose result)
        {
            IFormatProvider provider = GetFormatProviderFromCultureName(cultureName);

            return(QuantityParser.Default.TryParse <AbsorbedDose, AbsorbedDoseUnit>(
                       str,
                       provider,
                       From,
                       out result));
        }