Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
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]);
        }
Exemplo n.º 3
0
        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);
            if (representation.RelatedDDI != null)
            {
                Ddi = representation.RelatedDDI[0].ddi;
                if (representation.RelatedDDI.Any(d => d.isDefaultRepresentationForDDI))
                {
                    IsDefaultRepresentationForDDI = true;
                }
            }

            _unitOfMeasureDefaults    = GetDefaultUnitOfMeasures(representation.Items);
            _unitOfMeasurePreferences = GetUnitOfMeasurePreferences(representation.Items);
        }
Exemplo n.º 4
0
 public NumericRepresentation(RepresentationSystemRepresentationsNumericRepresentation representation)
     : this(representation, CultureInfo.CurrentUICulture)
 {
 }