当前位置: 首页>>代码示例>>C#>>正文


C# IDataStructureObject.GetComponent方法代码示例

本文整理汇总了C#中IDataStructureObject.GetComponent方法的典型用法代码示例。如果您正苦于以下问题:C# IDataStructureObject.GetComponent方法的具体用法?C# IDataStructureObject.GetComponent怎么用?C# IDataStructureObject.GetComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDataStructureObject的用法示例。


在下文中一共展示了IDataStructureObject.GetComponent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetCurrentDsd

        /// <summary>
        /// Sets the current DSD.
        /// </summary>
        /// <param name="currentDsd">
        /// The current DSD.
        /// </param>
        /// <exception cref="SdmxNotImplementedException">
        /// Time series without time dimension
        /// </exception>
        protected override void SetCurrentDsd(IDataStructureObject currentDsd)
        {
            base.SetCurrentDsd(currentDsd);

            // reset all maps
            this._dimensionConcepts = new List<string>();
            this._datasetAttributes = new HashSet<string>(StringComparer.Ordinal);
            this._seriesAttributes = new HashSet<string>(StringComparer.Ordinal);
            this._observationAttributes = new HashSet<string>(StringComparer.Ordinal);
            this._groups = new List<string>();
            this._groupConcepts = new Dictionary<string, List<string>>(StringComparer.Ordinal);

            if (this.DatasetHeader.DataStructureReference != null)
            {
                this.SetDimensionAtObservation(this.DatasetHeader.DataStructureReference.DimensionAtObservation);
            }
            else
            {
                this.SetDimensionAtObservation(DimensionObject.TimeDimensionFixedId);
            }

            // Roll up any attribute values
            foreach (var valuePair in this._attributesOnDatasetNode)
            {
                var component = currentDsd.GetComponent(valuePair.Key);
                if (component != null)
                {
                    this._rolledUpAttributes.Add(valuePair);
                }
            }

            // Create a list of dimension concepts
            foreach (var dimension in currentDsd.GetDimensions(SdmxStructureEnumType.Dimension, SdmxStructureEnumType.MeasureDimension))
            {
                this._dimensionConcepts.Add(dimension.Id);
            }

            // Create a list of dataset attribute concepts
            foreach (var datasetAttribute in currentDsd.DatasetAttributes)
            {
                this._datasetAttributes.Add(datasetAttribute.Id);
            }

            // Create a list of dimension group attribute concepts
            foreach (var dimensionGroupAttribute in currentDsd.DimensionGroupAttributes)
            {
                this._seriesAttributes.Add(dimensionGroupAttribute.Id);
            }

            // Create a list of observation attribute concepts
            foreach (var observationAttribute in currentDsd.ObservationAttributes)
            {
                this._observationAttributes.Add(observationAttribute.Id);
            }

            this._primaryMeasureConcept = currentDsd.PrimaryMeasure.Id;

            if (currentDsd.TimeDimension == null)
            {
                throw new SdmxNotImplementedException(string.Format(CultureInfo.InvariantCulture, "The DSD: {0} has no time dimension. This is unsupported!", currentDsd.Id));
            }

            this._timeConcept = currentDsd.TimeDimension.Id;

            foreach (var dsdGroup in currentDsd.Groups)
            {
                string groupId = dsdGroup.Id;
                this._groups.Add(groupId);

                ISet<string> groupAttributes = new HashSet<string>(currentDsd.GetGroupAttributes(groupId, true).Select(o => o.Id), StringComparer.Ordinal);
                this._groupAttributeConcepts.Add(groupId, groupAttributes);

                var groups = new List<string>();
                PopulateGroupContents(dsdGroup, groups);
                this._groupConcepts.Add(groupId, groups);
            }
        }
开发者ID:SDMXISTATFRAMEWORK,项目名称:ISTAT_ENHANCED_SDMXRI_WS,代码行数:86,代码来源:CompactDataReaderEngine.cs


注:本文中的IDataStructureObject.GetComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。