Contains a set of attribute definitions for a SpecRelation element. Inherits a set of attribute definitions from SpecType. By using SpecObjectType elements, multiple requirements 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>
        /// Asynchronously reads the <see cref="SpecType"/> which is specific to the <see cref="SpecRelation"/> 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("SPEC-RELATION-TYPE-REF"))
            {
                var reference = await reader.ReadElementContentAsStringAsync();

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

                if (specType == null)
                {
                    this.logger.LogTrace("The SpecRelationType:{reference} could not be found and has been set to null on SpecRelation:{Identifier}", reference, Identifier);
                }
            }
        }