예제 #1
0
 /// <summary>
 /// Deserialize the <see cref="DatatypeDefinition"/>s contained by the <code>DATATYPES</code> element.
 /// </summary>
 /// <param name="reader">
 /// an instance of <see cref="XmlReader"/>
 /// </param>
 private void DeserializeDataTypes(XmlReader reader)
 {
     while (reader.Read())
     {
         if (reader.MoveToContent() == XmlNodeType.Element && reader.LocalName.StartsWith("DATATYPE-DEFINITION-"))
         {
             var datatypeDefinition = ReqIfFactory.DatatypeDefinitionConstruct(reader.LocalName, this);
             datatypeDefinition.ReadXml(reader);
         }
     }
 }
예제 #2
0
        /// <summary>
        /// Asynchronously deserialize the <see cref="DatatypeDefinition"/>s contained by the <code>DATATYPES</code> element.
        /// </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>
        private async Task DeserializeDataTypesAsync(XmlReader reader, CancellationToken token)
        {
            while (await reader.ReadAsync())
            {
                if (token.IsCancellationRequested)
                {
                    token.ThrowIfCancellationRequested();
                }

                if (await reader.MoveToContentAsync() == XmlNodeType.Element && reader.LocalName.StartsWith("DATATYPE-DEFINITION-"))
                {
                    var datatypeDefinition = ReqIfFactory.DatatypeDefinitionConstruct(reader.LocalName, this, this.loggerFactory);
                    await datatypeDefinition.ReadXmlAsync(reader, token);
                }
            }
        }