本文整理汇总了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 ");
}
}
示例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;
}
}