Esempio n. 1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="name"></param>
 /// <param name="value"></param>
 /// <param name="unit"></param>
 public ReportItem(string name, object value, Unit unit, string format)
 {
     this.Name = name;
     this.Value = value;
     this.Unit = unit;
     this.Format = format;
 }
Esempio n. 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <param name="orderNumber"></param>
        /// <param name="unit"></param>
        public DataItemAttribute(string name, int orderNumber, Unit unit, string format)
        {
            this._name = name;
            this._orderNumber = orderNumber;

            if (unit == null)
            {
                throw new ArgumentNullException("unit");
            }
            this._unit = unit;
            this._format = format;
            Console.WriteLine(this._format);
        }
Esempio n. 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <param name="valueType"></param>
        /// <param name="value"></param>
        /// <param name="unit"></param>
        /// <param name="orderNumber"></param>
        /// <param name="description"></param>
        public ParameterBase(string name, Type valueType, object value, Unit unit, int orderNumber, string description)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            if (valueType == null)
            {
                throw new ArgumentNullException("valueType");
            }

            this.Name = name;
            this.ValueType = valueType;
            this.Value = value;
            this.Unit = unit;
            this.OrderNumber = orderNumber;
            this.Description = description;
        }
Esempio n. 4
0
File: Unit.cs Progetto: hkiaipc/C3
        /// <summary>
        /// 
        /// </summary>
        static Unit()
        {
            object[] objs = new object[]
            {
                UnitType.None , new string[] {""},

                    UnitType.Flow  ,new string[] {"m3/s", "m3/h"},
                    UnitType.Length , new string[] {"mm","cm","m"},
                    UnitType.Press , new string[] {"pa","mpa"},
                    UnitType.Temperature, new string[] {"c"},
                    UnitType.Time, new string[] {"second","minute","hour"},
                    UnitType.Volume,  new string[] {"m3"},
            };

            for (int i = 0; i < objs.Length; i += 2)
            {
                UnitType ut = (UnitType)objs[i];
                string[] values = (string[])objs[i + 1];
                foreach (string value in values)
                {
                    Unit unit = new Unit(value, ut);

                    string key = value.ToUpper();
                    _hash[key] = unit;
                }
            }
        }
Esempio n. 5
0
File: Unit.cs Progetto: hkiaipc/C3
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public static Unit FindByName(string name)
 {
     string key = name.Trim().ToUpper();
     object obj = _hash[key];
     if (obj != null)
     {
         return (Unit)obj;
     }
     else
     {
         Unit newUnit = new Unit(name, UnitType.None);
         _hash[key] = newUnit;
         return newUnit;
         //throw new ArgumentException(string.Format("not fine unit '{0}'", name));
     }
 }
Esempio n. 6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="name"></param>
 /// <param name="value"></param>
 /// <param name="unit"></param>
 public ReportItem(string name, object value, Unit unit)
     : this(name, value, unit, null)
 {
 }