Contains a set of attribute definitions for a Specification element. Inherits a set of attribute definitions from SpecType. By using SpecificationType elements, multiple specifications can be associated with the same set of attribute definitions (attribute names, default values, data types, etc.).
Inheritance: ReqIFSharp.SpecType
Ejemplo n.º 1
0
 /// <summary>
 /// Reads the <see cref="SpecType"/> which is specific to the <see cref="Specification"/> class.
 /// </summary>
 /// <param name="reader">
 /// an instance of <see cref="XmlReader"/>
 /// </param>
 protected override void ReadSpecType(XmlReader reader)
 {
     if (reader.ReadToDescendant("SPECIFICATION-TYPE-REF"))
     {
         var reference = reader.ReadElementContentAsString();
         var specType  = this.ReqIFContent.SpecTypes.SingleOrDefault(x => x.Identifier == reference);
         this.Type = (SpecificationType)specType;
     }
 }
Ejemplo n.º 2
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(SpecificationType))
            {
                throw new ArgumentException("specType must of type SpecificationType");
            }

            this.Type = (SpecificationType)specType;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Asynchronously reads the <see cref="SpecType"/> which is specific to the <see cref="Specification"/> class.
        /// </summary>
        /// <param name="reader">
        /// an instance of <see cref="XmlReader"/>
        /// </param>
        /// <param name="token">
        /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        protected override async Task ReadSpecTypeAsync(XmlReader reader, CancellationToken token)
        {
            if (token.IsCancellationRequested)
            {
                token.ThrowIfCancellationRequested();
            }

            if (reader.ReadToDescendant("SPECIFICATION-TYPE-REF"))
            {
                var reference = await reader.ReadElementContentAsStringAsync();

                var specType = this.ReqIFContent.SpecTypes.SingleOrDefault(x => x.Identifier == reference);
                this.Type = (SpecificationType)specType;
            }
        }