///////////////////////////////////////////////////////////////////////
        /// <summary>Returns the values of all the attribute of type
        /// intUnit, floatUnit or numberUnit with this name.</summary>
        /// <param name="name">attribute name</param>
        /// <returns>all the values found, never nul</returns>
        ///////////////////////////////////////////////////////////////////////
        public List <NumberUnit> GetNumberUnitAttributes(string name)
        {
            List <NumberUnit> retval = new List <NumberUnit>();

            foreach (GBaseAttribute attribute
                     in GetAttributes(name, GBaseAttributeType.NumberUnit))
            {
                NumberUnit value = toNumberUnit(attribute);
                if (value != null)
                {
                    retval.Add(value);
                }
            }
            return(retval);
        }
 ///////////////////////////////////////////////////////////////////////
 /// <summary>Adds a new attribute of type numberUnit.</summary>
 /// <param name="name">attribute name</param>
 /// <param name="value">attribute value</param>
 /// <returns>the newly-created GBaseAttribute object</returns>
 ///////////////////////////////////////////////////////////////////////
 public GBaseAttribute AddNumberUnitAttribute(string name, NumberUnit value)
 {
     return(Add(new GBaseAttribute(name,
                                   GBaseAttributeType.NumberUnit,
                                   value.ToString())));
 }
 ///////////////////////////////////////////////////////////////////////
 /// <summary>Adds a new attribute of type numberUnit.</summary>
 /// <param name="name">attribute name</param>
 /// <param name="value">attribute value</param>
 /// <returns>the newly-created GBaseAttribute object</returns>
 ///////////////////////////////////////////////////////////////////////
 public GBaseAttribute AddNumberUnitAttribute(string name, NumberUnit value)
 {
     return Add(new GBaseAttribute(name,
                                   GBaseAttributeType.NumberUnit,
                                   value.ToString()));
 }
コード例 #4
0
 ///////////////////////////////////////////////////////////////////////
 /// <summary>Copy constructor.</summary>
 ///////////////////////////////////////////////////////////////////////
 public IntUnit(NumberUnit orig)
         : base(orig.Unit)
 {
     this.number = orig.IntValue;
 }
コード例 #5
0
 ///////////////////////////////////////////////////////////////////////
 /// <summary>Copy constructor.</summary>
 ///////////////////////////////////////////////////////////////////////
 public FloatUnit(NumberUnit orig)
         : base(orig.Unit)
 {
     this.number = orig.FloatValue;
 }
コード例 #6
0
 ///////////////////////////////////////////////////////////////////////
 /// <summary>Copy constructor.</summary>
 ///////////////////////////////////////////////////////////////////////
 public IntUnit(NumberUnit orig)
     : base(orig.Unit)
 {
     this.number = orig.IntValue;
 }
コード例 #7
0
 ///////////////////////////////////////////////////////////////////////
 /// <summary>Copy constructor.</summary>
 ///////////////////////////////////////////////////////////////////////
 public FloatUnit(NumberUnit orig)
     : base(orig.Unit)
 {
     this.number = orig.FloatValue;
 }