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


C# IDataStructureObject.GetDimension方法代码示例

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


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

示例1: CheckDimensionExistence

	    /**
	     * It checks for the existence of the provided dimensionAtObs in the data structure definition.
	     * If it is not included an error is thrown.
	     * @param dimensionAtObs
	     * @param dataStructure
	     */
	    private void CheckDimensionExistence(string dimensionAtObs, IDataStructureObject dataStructure) 
        {
		    IDimension dimension = dataStructure.GetDimension(dimensionAtObs);
	        if (dimension == null)
	        {
                // Changed from ArgumentException in order for Web Service to produce the correct error (semantic).
                // This is different than in SdmxSource Java where it throws the equivalent of ArgumentException. 
	            throw new SdmxSemmanticException("Can not create DataQuery, The dimension at observation is not included in the Dimension list of the DSD ");
	        }
        }
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:16,代码来源:ComplexDataQueryImpl.cs

示例2: StartDataset

        /// <summary>
        /// Starts a dataset with the data conforming to the DSD
        /// </summary>
        /// <param name="dataflow">Optional. The dataflow can be provided to give extra information about the dataset.</param>
        /// <param name="dsd">The <see cref="IDataStructureObject" /> for which the dataset will be created</param>
        /// <param name="header">The <see cref="IDatasetHeader" /> of the dataset</param>
        /// <param name="annotations">Any additional annotations that are attached to the dataset, can be null if no annotations exist</param>
        /// <exception cref="System.ArgumentNullException">if the <paramref name="dsd" /> is null</exception>
        public override void StartDataset(IDataflowObject dataflow, IDataStructureObject dsd, IDatasetHeader header, params IAnnotation[] annotations)
        {
            this.CheckDisposed();

            base.StartDataset(dataflow, dsd, header);
            if (dsd == null)
            {
                throw new ArgumentNullException("dsd");
            }

            switch (this.TargetSchema.EnumType)
            {
                case SdmxSchemaEnumType.VersionOne:
                case SdmxSchemaEnumType.VersionTwo:
                    WriterHelper.ValidateErrors(Validator.ValidateForCompact(dsd));
                    break;
                case SdmxSchemaEnumType.VersionTwoPointOne:
                    this._isCrossSectional =
                        DimensionObject.TimeDimensionFixedId.Equals(this.DimensionAtObservation);
                    this._isFlat = this.DimensionAtObservation.Equals(Api.Constants.DimensionAtObservation.GetFromEnum(DimensionAtObservationEnumType.All).Value);

                    if (!this._isFlat)
                    {
                        IDimension dimension = dsd.GetDimension(this.DimensionAtObservation);
                        if (dimension == null)
                        {
                            throw new ArgumentNullException(
                                "Can not start dataset.  The dimension at observation has been set to '" +
                                this.DimensionAtObservation + "', but this dimension does not exist in the datastructure '" +
                                dsd.Urn + "'");
                        }
                    }

                    break;
            }
        }
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:44,代码来源:DataWriterEngineBase.cs


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