Exemple #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;
        }
Exemple #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");
        }