Пример #1
0
        /// <summary>
        /// Gets annotations type.
        /// </summary>
        /// <param name="annotable">
        /// The annotable.
        /// </param>
        /// <returns>
        /// The <see cref="AnnotationsType"/>.
        /// </returns>
        internal AnnotationsType GetAnnotationsType(IAnnotableObject annotable)
        {
            if (!ObjectUtil.ValidCollection(annotable.Annotations))
            {
                return null;
            }

            var returnType = new AnnotationsType();

            /* foreach */
            foreach (IAnnotation currentAnnotationBean in annotable.Annotations)
            {
                var annotation = new AnnotationType();
                returnType.Annotation.Add(annotation);
                string value2 = currentAnnotationBean.Id;
                if (!string.IsNullOrWhiteSpace(value2))
                {
                    annotation.id = currentAnnotationBean.Id;
                }

                if (ObjectUtil.ValidCollection(currentAnnotationBean.Text))
                {
                    annotation.AnnotationText = this.GetTextType(currentAnnotationBean.Text);
                }

                string value1 = currentAnnotationBean.Title;
                if (!string.IsNullOrWhiteSpace(value1))
                {
                    annotation.AnnotationTitle = currentAnnotationBean.Title;
                }

                string value = currentAnnotationBean.Type;
                if (!string.IsNullOrWhiteSpace(value))
                {
                    annotation.AnnotationType1 = currentAnnotationBean.Type;
                }

                if (currentAnnotationBean.Uri != null)
                {
                    annotation.AnnotationURL = currentAnnotationBean.Uri;
                }
            }

            return returnType;
        }
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="SchemeMapCore"/> class.
        /// </summary>
        /// <param name="createdFrom">
        /// The created from. 
        /// </param>
        /// <param name="structureType">
        /// The structure type. 
        /// </param>
        /// <param name="id">
        /// The id. 
        /// </param>
        /// <param name="uri">
        /// The uri. 
        /// </param>
        /// <param name="name">
        /// The name. 
        /// </param>
        /// <param name="description">
        /// The description. 
        /// </param>
        /// <param name="annotationsType">
        /// The annotations type. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        internal SchemeMapCore(
            IXmlSerializable createdFrom, 
            SdmxStructureType structureType, 
            string id, 
            Uri uri, 
            IList<TextType> name, 
            IList<TextType> description, 
            AnnotationsType annotationsType, 
            IIdentifiableObject parent)
            : base(createdFrom, structureType, id, uri, name, description, annotationsType, parent)
        {
        }
		///////////////////////////////////////////////////////////////////////////////////////////////////
		////////////BUILD FROM V2 SCHEMA                 //////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////

		/// <summary>
		/// Initializes a new instance of the <see cref="ComponentCore"/> class.
		/// </summary>
		/// <param name="createdFrom">
		/// The created from. 
		/// </param>
		/// <param name="structureType">
		/// The structure type. 
		/// </param>
		/// <param name="annotationType">
		/// The annotation type. 
		/// </param>
		/// <param name="textFormat">
		/// The text format. 
		/// </param>
		/// <param name="codelistAgency">
		/// The codelist agency. 
		/// </param>
		/// <param name="codelistId">
		/// The codelist id. 
		/// </param>
		/// <param name="codelistVersion">
		/// The codelist version. 
		/// </param>
		/// <param name="conceptSchemeAgency">
		/// The concept scheme agency. 
		/// </param>
		/// <param name="conceptSchemeId">
		/// The concept scheme id. 
		/// </param>
		/// <param name="conceptSchemeVersion">
		/// The concept scheme version. 
		/// </param>
		/// <param name="conceptAgency">
		/// The concept agency. 
		/// </param>
		/// <param name="conceptId">
		/// The concept id. 
		/// </param>
		/// <param name="parent">
		/// The parent. 
		/// </param>
		protected internal ComponentCore(
			IXmlSerializable createdFrom, 
			SdmxStructureType structureType, 
			AnnotationsType annotationType, 
			TextFormatType textFormat, 
			string codelistAgency, 
			string codelistId, 
			string codelistVersion, 
			string conceptSchemeAgency, 
			string conceptSchemeId, 
			string conceptSchemeVersion, 
			string conceptAgency, 
			string conceptId, 
			IIdentifiableObject parent)
			: base(createdFrom, structureType, conceptId, null, annotationType, parent)
		{
			if (string.IsNullOrWhiteSpace(conceptAgency))
			{
				conceptAgency = this.MaintainableParent.AgencyId;
			}

			if (textFormat != null || ObjectUtil.ValidOneString(codelistAgency, codelistId, codelistVersion))
			{
				if (ObjectUtil.ValidOneString(codelistAgency, codelistId, codelistVersion))
				{
					if (string.IsNullOrWhiteSpace(codelistAgency))
					{
						codelistAgency = this.MaintainableParent.AgencyId;
					}
				}

				this.LocalRepresentation = new RepresentationCore(
					textFormat, codelistAgency, codelistId, codelistVersion, this);
			}

			this._conceptRef = ConceptRefUtil.BuildConceptRef(
				this, conceptSchemeAgency, conceptSchemeId, conceptSchemeVersion, conceptAgency, conceptId);
			this.ValidateComponentAttributes();
		}
Пример #4
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="ItemSchemeMapCore"/> class.
        /// </summary>
        /// <param name="createdFrom">
        /// The created from. 
        /// </param>
        /// <param name="structureType">
        /// The structure type. 
        /// </param>
        /// <param name="id">
        /// The id. 
        /// </param>
        /// <param name="uri">
        /// The uri. 
        /// </param>
        /// <param name="name">
        /// The name. 
        /// </param>
        /// <param name="description">
        /// The description. 
        /// </param>
        /// <param name="annotationsType">
        /// The annotations type. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        protected ItemSchemeMapCore(
            IXmlSerializable createdFrom, 
            SdmxStructureType structureType, 
            string id, 
            Uri uri, 
            IList<TextType> name, 
            IList<TextType> description, 
            AnnotationsType annotationsType, 
            IIdentifiableObject parent)
            : base(createdFrom, structureType, id, uri, name, description, annotationsType, parent)
        {
            this._items = new List<IItemMap>();
        }
Пример #5
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="NameableCore"/> class.
        /// </summary>
        /// <param name="createdFrom">
        /// The created from. 
        /// </param>
        /// <param name="structureType">
        /// The structure type. 
        /// </param>
        /// <param name="id">
        /// The id. 
        /// </param>
        /// <param name="uri">
        /// The uri. 
        /// </param>
        /// <param name="name0">
        /// The name 0. 
        /// </param>
        /// <param name="description1">
        /// The description 1. 
        /// </param>
        /// <param name="annotationsType">
        /// The annotations type. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        protected NameableCore(
            IXmlSerializable createdFrom, 
            SdmxStructureType structureType, 
            string id, 
            Uri uri, 
            IList<TextType> name0, 
            IList<TextType> description1, 
            AnnotationsType annotationsType, 
            IIdentifiableObject parent)
            : base(createdFrom, structureType, id, uri, annotationsType, parent)
        {
            this.name = new List<ITextTypeWrapper>();
            this.description = new List<ITextTypeWrapper>();
            this.name = TextTypeUtil.WrapTextTypeV2(name0, this);
            this.description = TextTypeUtil.WrapTextTypeV2(description1, this);
            this.ValidateNameableAttributes();
        }
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="IdentifiableCore"/> class.
        /// </summary>
        /// <param name="createdFrom">
        /// The created from.
        /// </param>
        /// <param name="structureType">
        /// The structure type.
        /// </param>
        /// <param name="id0">
        /// The id 0.
        /// </param>
        /// <param name="uri1">
        /// The uri 1.
        /// </param>
        /// <param name="annotationsType">
        /// The annotations type.
        /// </param>
        /// <param name="parent">
        /// The parent.
        /// </param>
        protected IdentifiableCore(IXmlSerializable createdFrom, SdmxStructureType structureType, string id0, Uri uri1, AnnotationsType annotationsType, ISdmxStructure parent)
            : base(createdFrom, annotationsType, structureType, parent)
        {
            this._id = id0;
            this.Uri = uri1;
            this.ValidateIdentifiableAttributes();
        }
Пример #7
0
		///////////////////////////////////////////////////////////////////////////////////////////////////
		////////////BUILD FROM V2 SCHEMA				 //////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////
		public ItemCore(XmlObject createdFrom,
				SdmxStructureType structureType, String id, String uri,
				IList<TextType> name, IList<TextType> description,
				AnnotationsType annotationsType, IIdentifiableObject parent) : base(createdFrom, structureType, id, uri, name, description, annotationsType, parent) {
		}