private IReportStructure GetReportStructure(IMetadataReport metadataReport, IList<IReportStructure> reportStructures) { /* foreach */ foreach (IReportStructure currentRS in reportStructures) { if (currentRS.Id.Equals(metadataReport.Id)) { return currentRS; } } throw new ReferenceException( "Can not find reference to report structure with id " + metadataReport.Id); }
public MetadataReportBaseCore(IReportStructure rs, IMetadataReport builtFrom, IIdentifiableRetrievalManager retrievalManager) : base(builtFrom) { this.reportedAttributes = new List<IReportedAttributeBase>(); this.builtFrom = builtFrom; this.target = new TargetObjectBaseCore(builtFrom.Target, retrievalManager); /* foreach */ foreach (IReportedAttribute reportedAttribute in builtFrom .ReportedAttributes) { IMetadataAttribute Ima = GetMetadataAttributeForRepotedAttribtue( reportedAttribute, rs.MetadataAttributes); reportedAttributes.Add(new ReportedAttributeObjectBaseCore(Ima, reportedAttribute, retrievalManager)); } }
/////////////////////////////////////////////////////////////////////////////////////////////////// ////////////BUILD FROM V2.1 SCHEMA ////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// #region Constructors and Destructors /// <summary> /// Initializes a new instance of the <see cref="TargetObjectCore"/> class. /// </summary> /// <param name="parent"> /// The parent. /// </param> /// <param name="type"> /// The type. /// </param> public TargetObjectCore(IMetadataReport parent, TargetType type) : base(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.MetadataReportTarget), parent) { this.referenceValues = new List<IReferenceValue>(); this.id = type.id; if (ObjectUtil.ValidCollection(type.ReferenceValue)) { foreach (ReferenceValueType refValue in type.ReferenceValue) { this.referenceValues.Add(new ReferenceValueObjectCore(this, refValue)); } } this.Validate(); }
private MetadataSetObjectCore(MetadataSetObjectCore metadataSet, IMetadataReport report) : base(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.MetadataSet), null) { this.setId = metadataSet.setId; this.structureRef = metadataSet.structureRef; this.reportingBeginDate = metadataSet.reportingBeginDate; this.reportingEndDate = metadataSet.reportingEndDate; this.publicationYear = metadataSet.publicationYear; this.validFromDate = metadataSet.validFromDate; this.validToDate = metadataSet.validToDate; this.publicationPeriod = metadataSet.publicationPeriod; this.dataProviderReference = metadataSet.dataProviderReference; this.names = metadataSet.names; this.reports.Add(report); }