Esempio n. 1
0
        public static Celsius From(IQuantity <double> q)
        {
            Scale <double> scale = Catalog.Scale(Celsius.Family, q.Unit);

            if (scale == null)
            {
                throw new InvalidOperationException(string.Format("Cannot convert \"{0}\" to \"Celsius\".", q.GetType().Name));
            }
            return(Celsius.From(scale.Create(q.Value)));
        }
Esempio n. 2
0
 public override ILevel <double> From(IQuantity <double> quantity)
 {
     return(Celsius.From(quantity));
 }
Esempio n. 3
0
 public int /* IComparable<Celsius> */ CompareTo(Celsius other)
 {
     return(this.m_level.CompareTo(other.m_level));
 }
Esempio n. 4
0
 public override ILevel <double> From(ILevel <double> level)
 {
     return(Celsius.From(level));
 }
Esempio n. 5
0
 public bool /* IEquatable<Celsius> */ Equals(Celsius other)
 {
     return(this.m_level == other.m_level);
 }