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


C# IDataStructureObject.GetDimensions方法代码示例

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


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

示例1: StartDataset

        public void StartDataset(string dsdName, IDataflowObject dataflow, IDataStructureObject dsd, IDatasetHeader header, params IAnnotation[] annotations)
        {

            string appPath = System.Web.HttpRuntime.AppDomainAppPath;
            string giorno = System.Web.HttpContext.Current.Timestamp.Day.ToString();
            string ora = System.Web.HttpContext.Current.Timestamp.Hour.ToString();
            string min = System.Web.HttpContext.Current.Timestamp.Minute.ToString();
            string secondi = System.Web.HttpContext.Current.Timestamp.Second.ToString();
            string ms = System.Web.HttpContext.Current.Timestamp.Millisecond.ToString();
            string namedir = giorno + ora + min + secondi + ms;
            
            dirPath = appPath + namedir;

            DirectoryInfo MyRoot = new DirectoryInfo(@appPath);
            MyRoot.CreateSubdirectory(namedir);

            IList<IDimension> dimensions = dsd.GetDimensions(SdmxStructureEnumType.Dimension);
            string[] ordinamento1 = new string[dimensions.Count];
            string[] ordinamento2 = new string[dsd.Components.Count];


            ordine = new string[dimensions.Count];
            ordineser = new string[dimensions.Count];
            int indord = 0;

            string valoredati = "";

            IList<IDimension> dimensions1 = dsd.GetDimensions(SdmxStructureEnumType.Dimension);
            foreach (IDimension dim in dimensions1)
            {
                _CsvZipDataWriter.WriteValue(dim.Id + "_code,");
                valoredati += dim.Id + "_code,";
                ordine[indord] = dim.Id;
                indord++;
            }

            valoredati += "VALUE,date";
            string newLinedati = string.Format("{0}{1}", valoredati, Environment.NewLine);

            csvdati.Append(newLinedati);

        }
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:42,代码来源:CsvZipBaseDataWriter.cs

示例2: BuildConceptSchemeRequest

        /// <summary>
        /// Build concept scheme requests from the concept scheme references of the specified KeyFamilyBean object
        /// </summary>
        /// <param name="kf">
        /// The KeyFamily to look for concept Scheme references
        /// </param>
        /// <returns>
        /// A list of concept scheme requests 
        /// </returns>
        public static IEnumerable<IStructureReference> BuildConceptSchemeRequest(IDataStructureObject kf)
        {
            var conceptSchemeSet = new Dictionary<string, object>();
            var ret = new List<IStructureReference>();
            var crossDsd = kf as ICrossSectionalDataStructureObject;

            List<IComponent> components = new List<IComponent>();

            components.AddRange(kf.GetDimensions());
            components.AddRange(kf.Attributes);
            if (kf.PrimaryMeasure != null)
            {
                components.Add(kf.PrimaryMeasure);
            }
            if (crossDsd != null)
            {
                components.AddRange(crossDsd.CrossSectionalMeasures);
            }

            ICollection<IComponent> comps = components;

            foreach (IComponent comp in comps)
            {
                string key = Utils.MakeKey(comp.ConceptRef.MaintainableReference.MaintainableId, comp.ConceptRef.MaintainableReference.Version, comp.ConceptRef.MaintainableReference.AgencyId);
                if (!conceptSchemeSet.ContainsKey(key))
                {
                    // create concept ref

                    var conceptSchemeRef = new StructureReferenceImpl(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.ConceptScheme))
                    {
                        MaintainableId = comp.ConceptRef.MaintainableReference.MaintainableId,
                        AgencyId = comp.ConceptRef.MaintainableReference.AgencyId,
                        Version = comp.ConceptRef.MaintainableReference.Version
                    };

                    // add it to request
                    ret.Add(conceptSchemeRef);

                    // added it to set of visited concept schemes
                    conceptSchemeSet.Add(key, null);
                }
            }

            return ret;
        }
开发者ID:alcardac,项目名称:SDMX_DATA_BROWSER,代码行数:54,代码来源:NsiClientHelper.cs

示例3: 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

示例4: GetSeriesKeyConcepts

        /// <summary>
        /// Returns the series key concepts.
        /// </summary>
        /// <param name="dataStructureObject">
        /// The data structure object.
        /// </param>
        /// <returns>
        /// The series key concepts.
        /// </returns>
        public static IList<string> GetSeriesKeyConcepts(IDataStructureObject dataStructureObject)
        {
            IList<string> keyConcepts = new List<string>();
            foreach (IDimension currentDimension in dataStructureObject.GetDimensions(SdmxStructureEnumType.Dimension, SdmxStructureEnumType.MeasureDimension))
            {
                keyConcepts.Add(currentDimension.Id);
            }

            return keyConcepts;
        }
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:19,代码来源:DataStructureUtil.cs

示例5: GetDimensionAtObservationLevel

        /**
	     * It returns the default value for the dimension at observation in accordance with the DSD. <br>
	     * For a time series DSD, the return value Equals to the Time Dimension. For a crossX DSD it returns the <br>
	     * measure dimension value
	     * @param dataStructure
	     * @return
	     */
	    private string GetDimensionAtObservationLevel(IDataStructureObject dataStructure) 
        {
            //// Change from the SdmxSource Java. 
            //// MAT-675 : Not all DSD have either time or measure dimension. The standard says in that case 
            //// use all (flat).
		    if (dataStructure.TimeDimension != null)
                return Api.Constants.DimensionAtObservation.GetFromEnum(DimensionAtObservationEnumType.Time).Value;

	        var measureDimension = dataStructure.GetDimensions(SdmxStructureEnumType.MeasureDimension).FirstOrDefault();
	        if (measureDimension != null)
	        {
	            return measureDimension.Id;
	        }

	        return Api.Constants.DimensionAtObservation.GetFromEnum(DimensionAtObservationEnumType.All).Value;
        }
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:23,代码来源:ComplexDataQueryImpl.cs

示例6: StartDataset

        public void StartDataset(string dsdName, IDataflowObject dataflow, IDataStructureObject dsd, IDatasetHeader header, params IAnnotation[] annotations)
        {
            myDsplStructure._info.Names = new List<DsplStructure.Name>();
            myDsplStructure._info.Descriptions = new List<DsplStructure.Name>();
            myDsplStructure._info.Languages = new List<DsplStructure.Languages>();

            myDsplStructure._provider.Names = new List<DsplStructure.Name>();            
            foreach (var item in dataflow.Names)
            {
                var names = new DsplStructure.Name();
                names.name = item.Value;
                names.lang = item.Locale;
                
                //info
                myDsplStructure._info.Names.Add(names);
                myDsplStructure._info.url = GetWebConfigInfo("urlAddress");                

                //provider            
                myDsplStructure._provider.Names.Add(names);
                myDsplStructure._provider.url = GetWebConfigInfo("urlAddress");
            }
            myDsplStructure._info.Languages = VerifyNames(dataflow);
                
            myDsplStructure._info.description= dsdName;
            

            var topic = new DsplStructure.Topic();         
            topic.id = dataflow.Name.PadRight(64);
            topic.Names = new List<DsplStructure.Name>();

            foreach (var item in dataflow.Names)
            {
                var names = new DsplStructure.Name();
                names.name = item.Value;
                names.lang = item.Locale;                
                topic.Names.Add(names);
            }

            myDsplStructure._topics.Add(topic);

            var table = new DsplStructure.Table();
            var colonne = new DsplStructure.Column(); 

            string appPath = System.Web.HttpRuntime.AppDomainAppPath;
            
            string giorno = System.Web.HttpContext.Current.Timestamp.Day.ToString();
            string ora = System.Web.HttpContext.Current.Timestamp.Hour.ToString();
            string min = System.Web.HttpContext.Current.Timestamp.Minute.ToString();
            string secondi = System.Web.HttpContext.Current.Timestamp.Second.ToString();
            string ms = System.Web.HttpContext.Current.Timestamp.Millisecond.ToString();
            string namedir = giorno + ora + min + secondi + ms;
            
            dirPath = appPath + namedir;

            DirectoryInfo MyRoot = new DirectoryInfo(@appPath);
            MyRoot.CreateSubdirectory(namedir);            

            IList<IDimension> dimensions = dsd.GetDimensions(SdmxStructureEnumType.Dimension);
            string[] ordinamento1 = new string[dimensions.Count];
            string[] ordinamento2 = new string[dsd.Components.Count];

            string codelist = "";
            string agenzia = "";
            string versione = "";

            var concept = new DsplStructure.Concept();
				
			// metrics
         	concept.id = "VALUE";                      
            concept.type = "float";
                   
            //Pietro
            concept.infoconcept.Names = new List<DsplStructure.Name>();
            concept.infoconcept.Descriptions = new List<DsplStructure.Name>();

                   
            foreach (var item in dataflow.Names)
            {
                var names = new DsplStructure.Name();
                names.lang = item.Locale;
                names.name = item.Value;
                concept.infoconcept.Names.Add(names);
            }
            myDsplStructure._concepts.Add(concept);

            var slices = new DsplStructure.Slice();
            slices.id = "DATI";

            slices.dimension = new List<String>();

            int indord = 0;

            foreach (IDimension dim in dimensions)
            {
                ISet<ICrossReference> isr = dim.Representation.CrossReferences;
                foreach (var x in isr)
                {
                    codelist = x.MaintainableReference.MaintainableId;
                    agenzia = x.MaintainableReference.AgencyId;
                    versione = x.MaintainableReference.Version;
//.........这里部分代码省略.........
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:101,代码来源:DsplBaseDataWriter.cs

示例7: SetDsdOrder

 public void SetDsdOrder(IDataStructureObject dsd)        
 {
     IList<IDimension> dimensions = dsd.GetDimensions(SdmxStructureEnumType.Dimension);
     ordine = new string[dimensions.Count];
     ordineser = new string[dimensions.Count];
 }
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:6,代码来源:DsplBaseDataWriter.cs

示例8: 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 data structure is used to know the dimensionality of the data</param>
        /// <param name="header">Dataset header containing, amongst others, the dataset action, reporting dates,
        /// dimension at observation if null then the dimension at observation is assumed to be TIME_PERIOD and the dataset action is assumed to be INFORMATION</param>
        /// <param name="annotations">Any additional annotations that are attached to the dataset, can be null if no annotations exist</param>
        /// <exception cref="T:System.ArgumentException">if the DSD is null</exception>
        public void StartDataset(string dsdName, IDataflowObject dataflow, IDataStructureObject dsd, IDatasetHeader header, params IAnnotation[] annotations)
        {
            this._actions.Enqueue(() => this._dataWriterEngine.StartDataset(dsdName, dataflow, dsd, header, annotations));


            IList<IDimension> dimensions = dsd.GetDimensions(SdmxStructureEnumType.Dimension);

            string[] ordinamento1 = new string[dimensions.Count];
            string[] ordinamento2 = new string[dsd.Components.Count];

        }
开发者ID:alcardac,项目名称:SDMXRI_WS_OF,代码行数:20,代码来源:CsvZipDelayedDataWriterEngine.cs


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