Example #1
0
        /// <summary>
        /// Build a CategoryScheme
        /// </summary>
        /// <returns>ICategorySchemeObject for SdmxObject</returns>
        public List <ICategorySchemeObject> GetCategoryScheme()
        {
            if (ReferencesObject == null)
            {
                ReferencesObject = new IReferencesObject();
            }

            CategorySchemeBuilder _CategorySchemeBuilder = new CategorySchemeBuilder(this.parsingObject, this.versionTypeResp);

            if (_categoryschemeMapping == null)
            {
                _categorisationMapping = new List <InternalDatasetObject>();
                _categoryschemeMapping = CreateCategoryObjects(out _categorisationMapping);
            }

            if (!parsingObject.ReturnStub)
            {
                List <ICategoryMutableObject> CategoriesHierarchy = RecursiveCreateCategoryHierarchy(_categoryschemeMapping);
                this.ReferencesObject.CategoryScheme = new List <ICategorySchemeObject>()
                {
                    _CategorySchemeBuilder.BuildCategorySchemeObject(CategoriesHierarchy)
                };
            }
            else
            {
                this.ReferencesObject.CategoryScheme = new List <ICategorySchemeObject>()
                {
                    _CategorySchemeBuilder.BuildCategorySchemeObject(null)
                };
            }
            return(this.ReferencesObject.CategoryScheme);
        }
Example #2
0
        /// <summary>
        /// Build a Categorisation
        /// </summary>
        /// <returns>list of ICategorisationObject for SdmxObject</returns>
        public List <ICategorisationObject> GetCategorisation()
        {
            if (ReferencesObject == null)
            {
                ReferencesObject = new IReferencesObject();
            }

            CategorySchemeBuilder _CategorySchemeBuilder = new CategorySchemeBuilder(this.parsingObject, this.versionTypeResp);

            if (_categoryschemeMapping == null)
            {
                _categorisationMapping = new List <InternalDatasetObject>();
                _categoryschemeMapping = CreateCategoryObjects(out _categorisationMapping);
            }

            this.ReferencesObject.Categorisation = new List <ICategorisationObject>();
            foreach (InternalDatasetObject dfl in _categorisationMapping)
            {
                this.ReferencesObject.Categorisation.Add(_CategorySchemeBuilder.BuildCategorisation(dfl.Code, dfl.Agency, dfl.Version, dfl.CategoryParent));
            }
            return(this.ReferencesObject.Categorisation);
        }