/// <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; } }
/// <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; }
/// <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; } }