Пример #1
0
        /// <summary>
        /// Sets the <see cref="SpecType"/>
        /// </summary>
        /// <param name="specType">
        /// The <see cref="SpecType"/> to set.
        /// </param>
        protected override void SetSpecType(SpecType specType)
        {
            if (specType.GetType() != typeof(RelationGroupType))
            {
                throw new ArgumentException("specType must of type RelationGroupType");
            }

            this.Type = (RelationGroupType)specType;
        }
Пример #2
0
        /// <summary>
        /// returns the XML element name of the specified <see cref="SpecType"/>.
        /// </summary>
        /// <param name="specType">
        /// an instance of <see cref="SpecType"/>.
        /// </param>
        /// <returns>
        /// a string that contains the XML element name.
        /// </returns>
        internal static string XmlName(SpecType specType)
        {
            if (specType is SpecObjectType)
            {
                return("SPEC-OBJECT-TYPE");
            }

            if (specType is SpecificationType)
            {
                return("SPECIFICATION-TYPE");
            }

            if (specType is SpecRelationType)
            {
                return("SPEC-RELATION-TYPE");
            }

            if (specType is RelationGroupType)
            {
                return("RELATION-GROUP-TYPE");
            }

            throw new ArgumentException($"The {specType.GetType()} type cannot be converted to an XML element name");
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AttributeDefinitionDate"/> class.
 /// </summary>
 /// <param name="specType">
 /// The owning <see cref="SpecType"/>.
 /// </param>
 internal AttributeDefinitionDate(SpecType specType)
     : base(specType)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AttributeDefinitionInteger"/> class.
 /// </summary>
 /// <param name="specType">
 /// The owning <see cref="SpecType"/>.
 /// </param>
 internal AttributeDefinitionInteger(SpecType specType)
     : base(specType)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AttributeDefinitionXHTML"/> class.
 /// </summary>
 /// <param name="specType">
 /// The owning <see cref="SpecType"/>.
 /// </param>
 internal AttributeDefinitionXHTML(SpecType specType)
     : base(specType)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AttributeDefinitionEnumeration"/> class.
 /// </summary>
 /// <param name="specType">
 /// The owning <see cref="SpecType"/>.
 /// </param>
 internal AttributeDefinitionEnumeration(SpecType specType)
     : base(specType)
 {
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AttributeDefinitionEnumeration"/> class.
 /// </summary>
 /// <param name="specType">
 /// The owning <see cref="SpecType"/>.
 /// </param>
 /// <param name="loggerFactory">
 /// The (injected) <see cref="ILoggerFactory"/> used to setup logging
 /// </param>
 internal AttributeDefinitionEnumeration(SpecType specType, ILoggerFactory loggerFactory)
     : base(specType, loggerFactory)
 {
     this.logger = this.loggerFactory == null ? NullLogger <AttributeDefinitionEnumeration> .Instance : this.loggerFactory.CreateLogger <AttributeDefinitionEnumeration>();
 }
Пример #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AttributeDefinitionReal"/> class.
 /// </summary>
 /// <param name="specType">
 /// The owning <see cref="SpecType"/>.
 /// </param>
 internal AttributeDefinitionReal(SpecType specType)
     : base(specType)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AttributeDefinitionString"/> class.
 /// </summary>
 /// <param name="specType">
 /// The owning <see cref="SpecType"/>.
 /// </param>
 internal AttributeDefinitionString(SpecType specType)
     : base(specType)
 {
 }
Пример #10
0
        /// <summary>
        /// Constructs a new instance <see cref="AttributeDefinition"/> based on the XML Name
        /// </summary>
        /// <param name="xmlname">
        /// The XML name of the <see cref="AttributeDefinition"/> that is to be constructed
        /// </param>
        /// <param name="specType">
        /// The owning <see cref="SpecType"/>
        /// </param>
        /// <param name="loggerFactory">
        /// The (injected) <see cref="ILoggerFactory"/> used to setup logging
        /// </param>
        /// <returns>
        /// an instance of <see cref="AttributeDefinition"/>
        /// </returns>
        /// <exception cref="ArgumentException">
        /// Thrown when an invalid <paramref name="xmlname"/> is provided
        /// </exception>
        internal static AttributeDefinition AttributeDefinitionConstruct(string xmlname, SpecType specType, ILoggerFactory loggerFactory)
        {
            switch (xmlname)
            {
            case "ATTRIBUTE-DEFINITION-BOOLEAN":
                return(new AttributeDefinitionBoolean(specType, loggerFactory));

            case "ATTRIBUTE-DEFINITION-DATE":
                return(new AttributeDefinitionDate(specType, loggerFactory));

            case "ATTRIBUTE-DEFINITION-ENUMERATION":
                return(new AttributeDefinitionEnumeration(specType, loggerFactory));

            case "ATTRIBUTE-DEFINITION-INTEGER":
                return(new AttributeDefinitionInteger(specType, loggerFactory));

            case "ATTRIBUTE-DEFINITION-REAL":
                return(new AttributeDefinitionReal(specType, loggerFactory));

            case "ATTRIBUTE-DEFINITION-STRING":
                return(new AttributeDefinitionString(specType, loggerFactory));

            case "ATTRIBUTE-DEFINITION-XHTML":
                return(new AttributeDefinitionXHTML(specType, loggerFactory));

            default:
                return(null);
            }
        }
Пример #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AttributeDefinition"/> class.
 /// </summary>
 /// <param name="specType">
 /// The owning <see cref="SpecType"/>.
 /// </param>
 /// <param name="loggerFactory">
 /// The (injected) <see cref="ILoggerFactory"/> used to setup logging
 /// </param>
 protected AttributeDefinition(SpecType specType, ILoggerFactory loggerFactory)
     : base(loggerFactory)
 {
     this.SpecType = specType;
     specType.SpecAttributes.Add(this);
 }
 /// <summary>
 /// Sets the <see cref="SpecType"/> to the sub class
 /// </summary>
 /// <param name="specType">
 /// The <see cref="SpecType"/> to set.
 /// </param>
 protected abstract void SetSpecType(SpecType specType);
Пример #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AttributeDefinitionBoolean"/> class.
 /// </summary>
 /// <param name="specType">
 /// The owning <see cref="SpecType"/>.
 /// </param>
 internal AttributeDefinitionBoolean(SpecType specType)
     : base(specType)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AttributeDefinitionSimple"/> class.
 /// </summary>
 /// <param name="specType">
 /// The owning <see cref="SpecType"/>.
 /// </param>
 /// <param name="loggerFactory">
 /// The (injected) <see cref="ILoggerFactory"/> used to setup logging
 /// </param>
 protected AttributeDefinitionSimple(SpecType specType, ILoggerFactory loggerFactory)
     : base(specType, loggerFactory)
 {
 }