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


C# IStructureReference.HasChildReference方法代码示例

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


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

示例1: GetError

 /// <summary>
 /// Returns an error message with the specified <paramref name="format"/> for <paramref name="reference"/>
 /// </summary>
 /// <param name="format">
 /// The format.
 /// </param>
 /// <param name="reference">
 /// The component.
 /// </param>
 /// <returns>
 /// The error message.
 /// </returns>
 public string GetError(string format, IStructureReference reference)
 {
     IMaintainableRefObject maintainableRefObject = reference.MaintainableReference;
     return reference.HasChildReference()
                ? string.Format(
                    format,
                    maintainableRefObject.MaintainableId,
                    maintainableRefObject.AgencyId,
                    maintainableRefObject.Version,
                    reference.ChildReference.Id,
                    reference.TargetReference)
                : string.Format(format, maintainableRefObject.MaintainableId, maintainableRefObject.AgencyId, maintainableRefObject.Version, reference.TargetReference);
 }
开发者ID:alcardac,项目名称:SDMXRI_ENH_WS,代码行数:25,代码来源:ValidateStatusEngine.cs

示例2: GetStructure

        /// <summary>
        /// Gets the structure.
        /// </summary>
        /// <param name="state">The state.</param>
        /// <param name="reference">The reference.</param>
        /// <returns>The <see cref="ItemStatusCollection"/></returns>
        public ItemSchemeFinalStatus GetStructure(DbTransactionState state, IStructureReference reference)
        {
            ItemSchemeFinalStatus returnObjet;
            if (!this._dictionary.TryGetValue(reference, out returnObjet))
            {
                var artefactFinalStatus = ArtefactBaseEngine.GetFinalStatus(state, reference);

                ItemStatusCollection collection = null;
                if (artefactFinalStatus != null && artefactFinalStatus.IsFinal && reference.HasChildReference())
                {
                    switch (reference.TargetReference.EnumType)
                    {
                        case SdmxStructureEnumType.Component:
                        case SdmxStructureEnumType.Dimension:
                        case SdmxStructureEnumType.TimeDimension:
                        case SdmxStructureEnumType.MeasureDimension:
                        case SdmxStructureEnumType.DataAttribute:
                        case SdmxStructureEnumType.PrimaryMeasure:
                        case SdmxStructureEnumType.CrossSectionalMeasure:
                            var map = GetComponentMapIds(state, reference);
                            collection = new ItemStatusCollection(map.Select(pair => new ItemStatus(pair.Key, pair.Value)));
                            break;
                        default:
                            collection = GetId(state, reference.TargetReference.EnumType, artefactFinalStatus.PrimaryKey);
                            break;
                    }
                }

                returnObjet = new ItemSchemeFinalStatus(artefactFinalStatus ?? ArtefactFinalStatus.Empty, collection);
            }

            return returnObjet;
        }
开发者ID:alcardac,项目名称:SDMXRI_ENH_WS,代码行数:39,代码来源:StructureCache.cs

示例3: SetReference

        /// <summary>
        /// Sets reference.
        /// </summary>
        /// <param name="refBase">
        /// The refBase.
        /// </param>
        /// <param name="crossReference">
        /// The cross reference.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="crossReference"/> is null
        ///     -or-
        ///     <paramref name="refBase"/> is null
        /// </exception>
        /// <exception cref="ValidationException">
        /// URN class is null
        /// </exception>
        protected internal void SetReference(RefBaseType refBase, IStructureReference crossReference)
        {
            if (refBase == null)
            {
                throw new ArgumentNullException("refBase");
            }

            if (crossReference == null)
            {
                throw new ArgumentNullException("crossReference");
            }

            IMaintainableRefObject maintRef = crossReference.MaintainableReference;
            if (crossReference.HasChildReference())
            {
                string fullId = GetFullIdentifiableId(crossReference);

                int lastIndexOf = fullId.LastIndexOf(DELIMITER);
                if (lastIndexOf > -1)
                {
                    string containerId = fullId.Substring(0, lastIndexOf);
                    string targetId = fullId.Substring(lastIndexOf, fullId.Length - lastIndexOf);
                    refBase.containerID = containerId;
                    refBase.id = targetId;
                }
                else
                {
                    refBase.id = fullId;
                }

                string value = maintRef.MaintainableId;
                if (!string.IsNullOrWhiteSpace(value))
                {
                    refBase.maintainableParentID = maintRef.MaintainableId;
                }

                string value1 = maintRef.Version;
                if (!string.IsNullOrWhiteSpace(value1))
                {
                    refBase.maintainableParentVersion = maintRef.Version;
                }
            }
            else
            {
                string value = maintRef.MaintainableId;
                if (!string.IsNullOrWhiteSpace(value))
                {
                    refBase.id = maintRef.MaintainableId;
                }

                string value1 = maintRef.Version;
                if (!string.IsNullOrWhiteSpace(value1))
                {
                    refBase.version = maintRef.Version;
                }
            }

            string value2 = maintRef.AgencyId;
            if (!string.IsNullOrWhiteSpace(value2))
            {
                refBase.agencyID = maintRef.AgencyId;
            }

            //// TODO because of differences in the Xml and LINQ2XSD generated code setting package and class might not be needed.
            SdmxStructureType sdmxStructureType = crossReference.TargetReference;

            //// TODO Assume that the PackageTypeCodelistType are the same as in SdmxStructureType.UrnPackage
            string urnPackage = sdmxStructureType.UrnPackage;
            refBase.package = urnPackage; //// PackageTypeCodelistType.TypeDefinition.

            string classEnum;
            switch (crossReference.TargetReference.EnumType)
            {
                //Place any exclusions to the rule in this case statement
                case SdmxStructureEnumType.DataAttribute:
                    classEnum = ObjectTypeCodelistTypeConstants.Attribute;
                    break;
                default:
                    string urnClass = crossReference.TargetReference.UrnClass;
                    classEnum = urnClass;//ObjectTypeCodelistType.Enum.forString(urnClass);
                    break;
            }

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


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