Beispiel #1
0
        //
        // - Methods -
        //

        /// <summary>
        /// Validate the value for a Content Item with Value Type Code.
        /// </summary>
        /// <param name="contentItemWithValueTypeCode">The Content Item.</param>
        private void ValidateValue(ContentItemWithValueTypeCode contentItemWithValueTypeCode)
        {
            ConceptCode conceptCode = contentItemWithValueTypeCode.ConceptCode;

            if (conceptCode == null)
            {
                contentItemWithValueTypeCode.ValidationResults.Add(new ValidationResult("Sequence Item encoding the Concept Code does not exist."));
            }
            else
            {
                conceptCodeValidationRule.ValidateUsingContextGroups(conceptCode);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Create a single Content Item instance without creating (possible) child Content Item instances.
        /// </summary>
        /// <remarks>
        /// The child Content Items will be created by the CreateContentItems methods.
        /// </remarks>
        /// <param name="attributeSet">The Attribute Set from which the Content Item is constructed.</param>
        /// <returns>A single Content Item instance.</returns>
        private static ContentItem CreateContentItem(AttributeSet attributeSet, ContentItem parentContentItem, uint position)
        {
            ContentItem contentItem = null;

            String valueType = Convert.FirstAttributeValueToString(attributeSet, "0x0040A040");

            valueType = valueType.TrimStart(' ');
            valueType = valueType.TrimEnd(' ');

            switch (valueType)
            {
                case "CODE":
                    contentItem = new ContentItemWithValueTypeCode(attributeSet, parentContentItem, position);
                    break;

                case "NUM":
                    contentItem = new ContentItemWithValueTypeNum(attributeSet, parentContentItem, position);
                    break;

                default:
                    contentItem = new ContentItem(attributeSet, parentContentItem, position);
                    break;
            }

            return (contentItem);
        }
        //
        // - Methods -
        //
        /// <summary>
        /// Validate the value for a Content Item with Value Type Code.
        /// </summary>
        /// <param name="contentItemWithValueTypeCode">The Content Item.</param>
        private void ValidateValue(ContentItemWithValueTypeCode contentItemWithValueTypeCode)
        {
            ConceptCode conceptCode = contentItemWithValueTypeCode.ConceptCode;

            if (conceptCode == null)
            {
                contentItemWithValueTypeCode.ValidationResults.Add(new ValidationResult("Sequence Item encoding the Concept Code does not exist."));
            }
            else
            {
                conceptCodeValidationRule.ValidateUsingContextGroups(conceptCode);
            }
        }