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


C# IComponent.HasCodedRepresentation方法代码示例

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


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

示例1: GetCodelist

        /// <summary>
        /// Gets a bean with data about the codelist for specified dataflow and component.
        /// The dataflow can be retrieved from <see cref="RetrieveCategorisations"/> and the component from <see cref="GetStructure"/>
        /// </summary>
        /// <param name="dataflow">
        /// The dataflow
        /// </param>
        /// <param name="component">
        /// The component
        /// </param>
        /// <param name="criteria">
        /// The criteria includes a set of Member and MemberValue(s) for each dimension. The Member has componentRef the dimension conceptRef and the MemberValue(s) specify the selected codes for this dimension.
        /// </param>
        /// <returns>
        /// A <c>CodeListBean</c> with the requested data
        /// </returns>
        public ICodelistObject GetCodelist(IDataflowObject dataflow, IDataStructureObject dsd, IComponent component, IContentConstraintMutableObject criteria)
        {
            var codelistRef = new StructureReferenceImpl(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.CodeList));
            var dimension = component as IDimension;
            if (dimension != null && dimension.TimeDimension)
            {
                codelistRef.MaintainableId = CustomCodelistConstants.TimePeriodCodeList;
                codelistRef.AgencyId = CustomCodelistConstants.Agency;
                codelistRef.Version = CustomCodelistConstants.Version;
            }
            else if (dimension != null && dimension.MeasureDimension && dsd is ICrossSectionalDataStructureObject)
            {
                var crossDsd = dsd as ICrossSectionalDataStructureObject;
                codelistRef.MaintainableId = crossDsd.GetCodelistForMeasureDimension(dimension.Id).MaintainableReference.MaintainableId;
                codelistRef.AgencyId = crossDsd.GetCodelistForMeasureDimension(dimension.Id).MaintainableReference.AgencyId;
                codelistRef.Version = crossDsd.GetCodelistForMeasureDimension(dimension.Id).MaintainableReference.Version;
            }
            else
            {
                if (component.HasCodedRepresentation())
                {
                codelistRef.MaintainableId = component.Representation.Representation.MaintainableReference.MaintainableId;
                codelistRef.AgencyId = component.Representation.Representation.MaintainableReference.AgencyId;
                codelistRef.Version = component.Representation.Representation.MaintainableReference.Version;
                }
            }

            string info = string.Format(
                CultureInfo.InvariantCulture,
                Resources.InfoPartialCodelistFormat3,
                Utils.MakeKey(dataflow),
                component.ConceptRef,
                Utils.MakeKey(codelistRef));
            return this.GetCodelist(dataflow, codelistRef, criteria, info);
        }
开发者ID:alcardac,项目名称:SDMX_DATA_BROWSER,代码行数:51,代码来源:NsiClientWS.cs

示例2: GetValueType

        /// <summary>
        /// Gets the type of the value.
        /// </summary>
        /// <param name="component">The component.</param>
        /// <param name="complexComponentValue">The complex component value.</param>
        /// <returns>The value type</returns>
        private static ValueType GetValueType(IComponent component, IComplexComponentValue complexComponentValue)
        {
            if (component.HasCodedRepresentation())
            {
                return ValueType.Value;
            }

            var defaultValueType = ValueType.TextValue;
            if (complexComponentValue.TextSearchOperator != null)
            {
                return ValueType.TextValue;
            }
            
            if (complexComponentValue.OrderedOperator != null)
            {
                switch (complexComponentValue.OrderedOperator.EnumType)
                {
                    case OrderedOperatorEnumType.GreaterThanOrEqual:
                    case OrderedOperatorEnumType.LessThanOrEqual:
                    case OrderedOperatorEnumType.LessThan:
                    case OrderedOperatorEnumType.GreaterThan:
                        defaultValueType = ValueType.NumericValue;
                        break;
                    default:
                        defaultValueType = ValueType.Value;
                        break;
                }
            }

            if (component.Representation != null && component.Representation.TextFormat != null)
            {
                if (component.Representation.TextFormat.TextType != null)
                {
                    switch (component.Representation.TextFormat.TextType.EnumType)
                    {
                        case TextEnumType.BasicTimePeriod:
                        case TextEnumType.DateTime:
                        case TextEnumType.Date:
                        case TextEnumType.Time:
                        case TextEnumType.Year:
                        case TextEnumType.Month:
                        case TextEnumType.Day:
                        case TextEnumType.MonthDay:
                        case TextEnumType.YearMonth:
                        case TextEnumType.Duration:
                        case TextEnumType.Timespan:
                        case TextEnumType.TimePeriod:
                        case TextEnumType.ObservationalTimePeriod:
                        case TextEnumType.GregorianDay:
                        case TextEnumType.GregorianTimePeriod:
                        case TextEnumType.GregorianYear:
                        case TextEnumType.GregorianYearMonth:
                        case TextEnumType.ReportingDay:
                        case TextEnumType.ReportingMonth:
                        case TextEnumType.ReportingQuarter:
                        case TextEnumType.ReportingSemester:
                        case TextEnumType.ReportingTimePeriod:
                        case TextEnumType.ReportingTrimester:
                        case TextEnumType.ReportingWeek:
                        case TextEnumType.ReportingYear:
                        case TextEnumType.StandardTimePeriod:
                        case TextEnumType.TimesRange:
                            return ValueType.TimeValue;
                        case TextEnumType.BigInteger:
                        case TextEnumType.Integer:
                        case TextEnumType.Long:
                        case TextEnumType.Short:
                        case TextEnumType.Decimal:
                        case TextEnumType.Float:
                        case TextEnumType.Double:
                        case TextEnumType.Count:
                        case TextEnumType.Numeric:
                        case TextEnumType.InclusiveValueRange:
                        case TextEnumType.ExclusiveValueRange:
                            return ValueType.NumericValue;
                        case TextEnumType.Boolean:
                            return ValueType.Value;
                    }
                }

                return defaultValueType;
            }

            // try guessing type from component type.
            switch (component.StructureType.EnumType)
            {
                case SdmxStructureEnumType.Dimension:
                    return ValueType.Value;
                case SdmxStructureEnumType.PrimaryMeasure:
                    return ValueType.NumericValue;
                case SdmxStructureEnumType.TimeDimension:
                    return ValueType.TimeValue;
            }

//.........这里部分代码省略.........
开发者ID:SDMXISTATFRAMEWORK,项目名称:ISTAT_ENHANCED_SDMXRI_WS,代码行数:101,代码来源:ComplexDataQueryCoreBuilderV21.cs

示例3: UpdateCodelistMap

 /// <summary>
 /// Update the codelist cache with the specified codelist and component
 /// </summary>
 /// <param name="codelist">
 /// The codelist
 /// </param>
 /// <param name="component">
 /// The component
 /// </param>
 public void UpdateCodelistMap(ICodelistObject codelist, IComponent component)
 {
     this._codelistCache.Update(component, codelist);
     this._codeTreeMap[component] = new CodeTreeBuilder(codelist);
     if (component.HasCodedRepresentation() && !string.IsNullOrEmpty(component.Representation.Representation.MaintainableReference.MaintainableId))
     {
         this.BuildCodeDescriptionMap(component);
     }
 }
开发者ID:alcardac,项目名称:SDMX_DATA_BROWSER,代码行数:18,代码来源:SessionQuery.cs

示例4: UpdateCodelistMap

        /// <summary>
        /// Update the codelist cache with the specified codelist and component
        /// </summary>
        /// <param name="codelist">
        /// The codelist
        /// </param>
        /// <param name="component">
        /// The component
        /// </param>
        public void UpdateCodelistMap(ICodelistObject codelist, IComponent component)
        {
            if (component.Id == KeyFamily.TimeDimension.Id)
            { this._codelistCache.Update(component, GetTimeCodeList(codelist));
            this._codeTreeMap[component] = new CodeTreeBuilder(GetTimeCodeList(codelist));
            }
            else
            { this._codelistCache.Update(component, codelist);
              this._codeTreeMap[component] = new CodeTreeBuilder(codelist);
            }

            if (component.HasCodedRepresentation() && !string.IsNullOrEmpty(component.Representation.Representation.MaintainableReference.MaintainableId))
            {
                this.BuildCodeDescriptionMap(component);
            }
        }
开发者ID:alcardac,项目名称:SDMX_DATA_BROWSER,代码行数:25,代码来源:SessionQuery.cs


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