/////////////////////////////////////////////////////////////////////////////////////////////////// ////////////BUILD FROM IMMUTABLE OBJECT ////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Initializes a new instance of the <see cref="ContentConstraintAttachmentMutableCore"/> class. /// </summary> /// <param name="immutable"> /// The immutable. /// </param> public ContentConstraintAttachmentMutableCore(IConstraintAttachment immutable) : base(immutable) { this._structureReference = new HashSet<IStructureReference>(); this._dataSources = new List<IDataSourceMutableObject>(); if (immutable.DataOrMetadataSetReference != null) { this._dataOrMetadataSetReference = immutable.DataOrMetadataSetReference.CreateMutableInstance(); } if (immutable.StructureReference != null) { foreach (ICrossReference xsRef in immutable.StructureReference) { this._structureReference.Add(xsRef.CreateMutableInstance()); } } if (ObjectUtil.ValidCollection(immutable.DataSources)) { foreach (IDataSource d in immutable.DataSources) { this._dataSources.Add(d.CreateMutableInstance()); } } }
/// <summary> /// Initializes a new instance of the <see cref="DataAndMetadataSetReferenceCore"/> class. /// </summary> /// <param name="mutable"> /// The mutable. /// </param> /// <exception cref="SdmxSemmanticException"> /// Throws Validate exception. /// </exception> public DataAndMetadataSetReferenceCore(IDataAndMetadataSetMutableReference mutable) { if (mutable.DataSetReference != null) { // this.IcrossReference = new CrossReferenceCore(this, mutable.getDataSetReference()); } this._id = mutable.SetId; this._isIsDataSetReference = mutable.IsDataSetReference; if (this._icrossReference == null) { throw new SdmxSemmanticException( "DataAndMetadataSetReferenceCore expects IcrossReference (null was provided)"); } if (this._id == null) { throw new SdmxSemmanticException("DataAndMetadataSetReferenceCore expects id (null was provided)"); } }