예제 #1
0
파일: Length.cs 프로젝트: hkiaipc/C3
        /// <summary>
        /// 
        /// </summary>
        static Length()
        {
            _factors = new Dictionary<LengthType, double>();
            _factors.Add(LengthType.mm, 1d);
            _factors.Add(LengthType.cm, 10d);
            _factors.Add(LengthType.dm, 100d);
            _factors.Add(LengthType.m, 1000d);
            _factors.Add(LengthType.km, 1000 * 1000d);

            _allowableDeviation = new Length(0.001, LengthType.mm);
        }
예제 #2
0
파일: Length.cs 프로젝트: hkiaipc/C3
 public Length(Length rhs)
     : this(rhs._value, rhs._lengthType)
 {
 }
예제 #3
0
파일: Length.cs 프로젝트: hkiaipc/C3
 /// <summary>
 /// 
 /// </summary>
 /// <param name="l1"></param>
 /// <param name="l2"></param>
 /// <returns></returns>
 public static Length operator -(Length l1, Length l2)
 {
     double valOfmm = l1.ToMM().Value - l2.ToMM().Value;
     Length r = new Length(valOfmm, LengthType.mm);
     return r.ConvertTo(l1.LengthType);
 }