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