Пример #1
0
        private static UnitDimension FindUnitDimension(RepresentationSystemRepresentationsNumericRepresentation representation)
        {
            if (representation.UnitDimensionRef == null)
                return null;

            var unitDimension = representation.UnitDimensionRef.unitDimension;
            if (string.IsNullOrEmpty(unitDimension))
                return null;

            return InternalUnitSystemManager.Instance.UnitDimensions[unitDimension];
        }
        public NumericRepresentation(RepresentationSystemRepresentationsNumericRepresentation representation, CultureInfo culture)
            : base(representation.domainID, representation.domainTag)
        {

            var name = GetName(representation.Name, culture);
            Name = name != null ? name.Value : null;
            Description = name != null ? name.description : null;
            UnitDimension = FindUnitDimension(representation);

            _unitOfMeasureDefaults = GetDefaultUnitOfMeasures(representation.Items);
            _unitOfMeasurePreferences = GetUnitOfMeasurePreferences(representation.Items);
        }
Пример #3
0
        public NumericRepresentation(RepresentationSystemRepresentationsNumericRepresentation representation)
            : this(representation, CultureInfo.CurrentUICulture)
        {

        }