コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RepresentationMapRefMutableCore"/> class.
        /// </summary>
        /// <param name="representationMapRef">
        /// The iref. 
        /// </param>
        public RepresentationMapRefMutableCore(IRepresentationMapRef representationMapRef)
            : base(representationMapRef)
        {
            this.valueMappings = new DictionaryOfSets<string, string>();
            if (representationMapRef.CodelistMap != null)
            {
                this.codelistMap = representationMapRef.CodelistMap.CreateMutableInstance();
            }

            if (representationMapRef.ToTextFormat != null)
            {
                this.toTextFormat = new TextFormatMutableCore(representationMapRef.ToTextFormat);
            }

            this.toValueType = representationMapRef.ToValueType;
            this.valueMappings = representationMapRef.ValueMappings;
        }
コード例 #2
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM MUTABLE OBJECTS             //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ComponentMapCore"/> class.
        /// </summary>
        /// <param name="compMap">
        /// The comp map. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        /// <exception cref="SdmxSemmanticException">
        /// Throws Validate exception.
        /// </exception>
        protected internal ComponentMapCore(IComponentMapMutableObject compMap, ISdmxStructure parent)
            : base(compMap, parent)
        {
            if (compMap.MapConceptRef != null)
            {
                this.mapConceptRef = compMap.MapConceptRef;
            }

            if (compMap.MapTargetConceptRef != null)
            {
                this.mapTargetConceptRef = compMap.MapTargetConceptRef;
            }

            if (compMap.RepMapRef != null)
            {
                this.repMapRef = new RepresentationMapRefCore(compMap.RepMapRef, this);
            }

            try
            {
                this.Validate();
            }
            catch (SdmxSemmanticException e)
            {
                throw new SdmxSemmanticException(e, ExceptionCode.FailValidation, this);
            }
        }
コード例 #3
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2.1 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="ComponentMapCore"/> class.
        /// </summary>
        /// <param name="compMap">
        /// The comp map. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        /// <exception cref="SdmxSemmanticException">
        /// Throws Validate exception.
        /// </exception>
        protected internal ComponentMapCore(ComponentMapType compMap, IStructureMapObject parent)
            : base(null, SdmxStructureType.GetFromEnum(SdmxStructureEnumType.CategoryMap), parent)
        {
            this.mapConceptRef = compMap.Source.GetTypedRef<LocalComponentListComponentRefType>().id;
            this.mapTargetConceptRef = compMap.Target.GetTypedRef<LocalComponentListComponentRefType>().id;
            if (compMap.RepresentationMapping != null)
            {
                this.repMapRef = new RepresentationMapRefCore(compMap.RepresentationMapping, this);
            }

            try
            {
                this.Validate();
            }
            catch (SdmxSemmanticException e)
            {
                throw new SdmxSemmanticException(e, ExceptionCode.FailValidation, this);
            }
        }