Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="measure{TValue}"/> class.
        /// </summary>
        /// <param name="role">The role.</param>
        /// <param name="system">The system.</param>
        /// <param name="defaultValue">The default value.</param>
        /// <param name="defaultBaseValue">The default base value.</param>
        /// <param name="levelsFromRoot">The levels from root.</param>
        protected measure(Enum role, measureSystemsEnum system, TValue defaultValue, TValue defaultBaseValue, Int32 levelsFromRoot = 0)
        {
            valueTypeGroup = valueType.getTypeGroup();

            info = measureSystemManager.getMeasureInfo(role, levelsFromRoot, system);
            setDefaultValue(defaultValue, defaultBaseValue);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="measureDecadeSystem"/> class.
        /// </summary>
        /// <param name="__name">The name.</param>
        public measureDecadeSystem(measureSystemsEnum __name)
        {
            name = __name.ToString();

            if (name == measureSystemsEnum.unknown.ToString())
            {
                name = this.GetType().Name;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the measure information.
        /// </summary>
        /// <param name="role">The role.</param>
        /// <param name="level">The level.</param>
        /// <param name="system">The system.</param>
        /// <returns></returns>
        public static measureInfo getMeasureInfo(Enum role, Int32 level, measureSystemsEnum system)
        {
            measureInfo output    = new measureInfo();
            var         decsystem = registry[system];
            var         unitdef   = decsystem.GetUnit(level);
            var         roledef   = decsystem.GetRole(role);

            output.setup(unitdef, roledef, decsystem);
            return(output);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets the measure information.
        /// </summary>
        /// <param name="roleName">Name of the role.</param>
        /// <param name="unitName">Name of the unit.</param>
        /// <param name="system">The system.</param>
        /// <returns></returns>
        public static measureInfo getMeasureInfo(Enum roleName, Enum unitName, measureSystemsEnum system)
        {
            measureInfo output    = new measureInfo();
            var         decsystem = registry[system];
            var         unitdef   = decsystem.GetUnitByName(unitName.ToString());
            var         roledef   = decsystem.GetRole(roleName);

            output.setup(unitdef, roledef, decsystem);
            return(output);
        }
Exemplo n.º 5
0
        public measureDecimal(measureRoleEnum role, measureSystemsEnum system, decimal defaultValue, decimal defaultBaseValue, decadeLevel level)
        {
            valueTypeGroup = valueType.getTypeGroup();
            Int32 levelsFromRoot = level.ToInt32From(decadeLevel.none);

            info = measureSystemManager.getMeasureInfo(role, levelsFromRoot, system);
            setDefaultValue(defaultValue, defaultBaseValue);

            //baseValue = 1;
        }
 /// <summary>
 /// Gets the <see cref="measureDecadeSystem"/> with the specified key.
 /// </summary>
 /// <value>
 /// The <see cref="measureDecadeSystem"/>.
 /// </value>
 /// <param name="key">The key.</param>
 /// <returns></returns>
 public measureDecadeSystem this[measureSystemsEnum key]
 {
     get
     {
         return(base[key.ToString()]);
     }
     internal set
     {
         Add(key.ToString(), value);
     }
 }
Exemplo n.º 7
0
 protected measureInteger(Enum role, measureSystemsEnum system, int defaultValue, int defaultBaseValue, int levelsFromRoot = 0) : base(role, system, defaultValue, defaultBaseValue, levelsFromRoot)
 {
 }
Exemplo n.º 8
0
 public measureDecimal(measureRoleEnum role, measureSystemsEnum system, decimal defaultValue, decimal defaultBaseValue = 1, Int32 level = 0) : base(role, system, defaultValue, defaultBaseValue, level)
 {
     //baseValue = 1;
 }