Esempio n. 1
0
        /// <summary>
        /// Asynchronously writes the <see cref="SpecType"/>s
        /// </summary>
        /// <param name="writer">
        /// an instance of <see cref="XmlWriter"/>
        /// </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 WriteSpecTypesAsync(XmlWriter writer, CancellationToken token)
        {
            if (token.IsCancellationRequested)
            {
                token.ThrowIfCancellationRequested();
            }

            if (this.specTypes.Count == 0)
            {
                return;
            }

            await writer.WriteStartElementAsync(null, "SPEC-TYPES", null);

            foreach (var specType in this.specTypes)
            {
                var xmlElementNAme = ReqIfFactory.XmlName(specType);
                await writer.WriteStartElementAsync(null, xmlElementNAme, null);

                await specType.WriteXmlAsync(writer, token);

                await writer.WriteEndElementAsync();
            }

            await writer.WriteEndElementAsync();
        }
Esempio n. 2
0
        /// <summary>
        /// Asynchronously writes the <see cref="DatatypeDefinition"/>s
        /// </summary>
        /// <param name="writer">
        /// an instance of <see cref="XmlWriter"/>
        /// </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 WriteDataDefinitionsAsync(XmlWriter writer, CancellationToken token)
        {
            if (token.IsCancellationRequested)
            {
                token.ThrowIfCancellationRequested();
            }

            if (this.dataTypes.Count == 0)
            {
                return;
            }

            await writer.WriteStartElementAsync(null, "DATATYPES", null);

            foreach (var datatypeDefinition in this.dataTypes)
            {
                var xmlElementNAme = ReqIfFactory.XmlName(datatypeDefinition);
                await writer.WriteStartElementAsync(null, xmlElementNAme, null);

                await datatypeDefinition.WriteXmlAsync(writer, token);

                await writer.WriteEndElementAsync();
            }

            await writer.WriteEndElementAsync();
        }
Esempio n. 3
0
        /// <summary>
        /// Write the <see cref="SpecType"/>s
        /// </summary>
        /// <param name="writer">
        /// an instance of <see cref="XmlWriter"/>
        /// </param>
        private void WriteSpecTypes(XmlWriter writer)
        {
            writer.WriteStartElement("SPEC-TYPES");

            foreach (var specType in this.specTypes)
            {
                var xmlElementNAme = ReqIfFactory.XmlName(specType);
                writer.WriteStartElement(xmlElementNAme);
                specType.WriteXml(writer);
                writer.WriteEndElement();
            }

            writer.WriteEndElement();
        }
Esempio n. 4
0
        /// <summary>
        /// Write the <see cref="DatatypeDefinition"/>s
        /// </summary>
        /// <param name="writer">
        /// an instance of <see cref="XmlWriter"/>
        /// </param>
        private void WriteDataDefinitions(XmlWriter writer)
        {
            writer.WriteStartElement("DATATYPES");

            foreach (var datatypeDefinition in this.dataTypes)
            {
                var xmlElementNAme = ReqIfFactory.XmlName(datatypeDefinition);
                writer.WriteStartElement(xmlElementNAme);
                datatypeDefinition.WriteXml(writer);
                writer.WriteEndElement();
            }

            writer.WriteEndElement();
        }
Esempio n. 5
0
        /// <summary>
        /// Writes the <see cref="AttributeDefinition"/> objects from the <see cref="SpecAttributes"/> list.
        /// </summary>
        /// <param name="writer">
        /// an instance of <see cref="XmlWriter"/>
        /// </param>
        private void WriteSpecAttributes(XmlWriter writer)
        {
            if (this.specAttributes.Count == 0)
            {
                return;
            }

            writer.WriteStartElement("SPEC-ATTRIBUTES");

            foreach (var attributeDefinition in this.specAttributes)
            {
                var xmlname = ReqIfFactory.XmlName(attributeDefinition);
                writer.WriteStartElement(xmlname);
                attributeDefinition.WriteXml(writer);
                writer.WriteEndElement();
            }

            writer.WriteEndElement();
        }
Esempio n. 6
0
        /// <summary>
        /// Asynchronously writes the <see cref="AttributeDefinition"/> objects from the <see cref="SpecAttributes"/> list.
        /// </summary>
        /// <param name="writer">
        /// an instance of <see cref="XmlWriter"/>
        /// </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 WriteSpecAttributesAsync(XmlWriter writer, CancellationToken token)
        {
            if (this.specAttributes.Count == 0)
            {
                return;
            }

            await writer.WriteStartElementAsync(null, "SPEC-ATTRIBUTES", null);

            foreach (var attributeDefinition in this.specAttributes)
            {
                var xmlname = ReqIfFactory.XmlName(attributeDefinition);
                await writer.WriteStartElementAsync(null, xmlname, null);

                await attributeDefinition.WriteXmlAsync(writer, token);

                await writer.WriteEndElementAsync();
            }

            await writer.WriteEndElementAsync();
        }