예제 #1
0
 /// <summary>
 /// 读取数值的构造方法
 /// </summary>
 /// <param name="temp">读取到的数据</param>
 public ValueUnit(string temp)
 {
     string[] strs = temp.Split('|');
     if (strs.Length == 2)
     {
         this.Value = long.Parse(strs[0]);
         this.Unit  = (Global.UnitType) int.Parse(strs[1]);
     }
     else
     {
         this.Value = 0;
         this.Unit  = Global.UnitType.Value;
     }
 }
예제 #2
0
 /// <summary>
 /// 复制构造函数
 /// </summary>
 /// <param name="value"></param>
 public ValueUnit(ValueUnit value)
 {
     this.Value = value.Value;
     this.Unit  = value.Unit;
 }
예제 #3
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="v">数值</param>
 /// <param name="u">单位(0数值,1百分比)</param>
 public ValueUnit(long v, int u)
 {
     this.Value = v;
     this.Unit  = (Global.UnitType)u;
 }
예제 #4
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="v">数值</param>
 /// <param name="u">单位(0数值,1百分比)</param>
 public ValueUnit(long v, string u)
 {
     this.Value = v;
     this.Unit  = (Global.UnitType) int.Parse(u);
 }
예제 #5
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="v">数值</param>
 /// <param name="u">单位</param>
 public ValueUnit(long v, Global.UnitType u)
 {
     this.Value = v;
     this.Unit  = u;
 }