Ejemplo n.º 1
0
        /// <summary>
        /// Add core properties of class
        /// </summary>
        private void _AddCoreProperty(PropertyInfo property, string prePath, DomainPropertyAttribute attribute,
            IList<object> mapProperties, IList<object> selectedMapProperties, StringCollection selectedConfig)
        {
            Unit? displayUnits = null;
            Unit? valueUnits = null;
            if (Attribute.IsDefined(property, typeof(UnitPropertyAttribute)))
            {
                UnitPropertyAttribute unitAttribute = (UnitPropertyAttribute)Attribute.GetCustomAttribute(
                    property, typeof(UnitPropertyAttribute));

                displayUnits = (RegionInfo.CurrentRegion.IsMetric) ? unitAttribute.DisplayUnitMetric : unitAttribute.DisplayUnitUS;
                valueUnits = unitAttribute.ValueUnits;
            }

            _AddPropertyTip(prePath, property.Name, attribute.Title, mapProperties,
                selectedMapProperties, selectedConfig, valueUnits, displayUnits);
        }
 private static void _AddProperty(PropertyInfo property, Type typeProperty, DomainPropertyAttribute attribute)
 {
     if (typeProperty == typeof(int) || typeProperty == typeof(double))
     {
         _quantityFieldTitles.Add(attribute.Title);
         _quantityFieldNames.Add(property.Name);
         _quantityFieldProperties.Add(property);
     }
 }