Esempio n. 1
0
        /// <summary>
        /// This writes the current state or attributes of this object,
        /// in the <c>XML</c> format, to the media or storage accessible by the given writer.
        /// </summary>
        /// <param name="writer">
        /// The <c>XML</c> writer with which the <c>XML</c> format of this object's state
        /// is written.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the <paramref name="reader"/> is <see langword="null"/>.
        /// </exception>
        public override void WriteXml(XmlWriter writer)
        {
            BuildExceptions.NotNull(writer, "writer");

            if (!this.IsValid)
            {
                return;
            }

            writer.WriteStartElement(TagName);  // start - TagName
            writer.WriteAttributeString("name", this.Name);

            writer.WriteStartElement("propertyGroup");  // start - propertyGroup
            writer.WriteAttributeString("name", "General");
            writer.WritePropertyElement("Title", this.Title);
            writer.WritePropertyElement("OverrideComments", _overrideComments.ToString());
            writer.WritePropertyElement("OverrideFilters", _overrideFilters.ToString());
            writer.WritePropertyElement("OverrideHierarchicalToc", _overrideHierarchicalToc.ToString());
            writer.WriteEndElement();              // end - propertyGroup

            writer.WriteStartElement("location");  // start - location
            _sourcePath.WriteXml(writer);
            writer.WriteEndElement();              // end - location

            // Write the user-defined contents...
            this.WriteContents(writer);

            // Write the filters...
            this.WriteFilters(writer);

            writer.WriteEndElement();           // end - TagName
        }
Esempio n. 2
0
        /// <summary>
        /// This writes the current state or attributes of this object,
        /// in the <c>XML</c> format, to the media or storage accessible by the given writer.
        /// </summary>
        /// <param name="writer">
        /// The <c>XML</c> writer with which the <c>XML</c> format of this object's state
        /// is written.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the <paramref name="reader"/> is <see langword="null"/>.
        /// </exception>
        public override void WriteXml(XmlWriter writer)
        {
            BuildExceptions.NotNull(writer, "writer");

            if (this.IsEmpty)
            {
                return;
            }

            writer.WriteStartElement(TagName);  // start - TagName
            writer.WriteAttributeString("name", _name);
            writer.WriteAttributeString("overrides", _overrides.ToString());

            writer.WriteTextElement("tag", _tag);
            writer.WriteTextElement("condition", _condition);
            writer.WriteTextElement("description", _description);
            writer.WriteStartElement("location");
            if (_scriptFile != null)  // should be for non-empty item
            {
                _scriptFile.WriteXml(writer);
            }
            writer.WriteEndElement();

            writer.WriteEndElement();           // end - TagName
        }
Esempio n. 3
0
        /// <summary>
        /// This writes the current state or attributes of this object,
        /// in the <c>XML</c> format, to the media or storage accessible by the given writer.
        /// </summary>
        /// <param name="writer">
        /// The <c>XML</c> writer with which the <c>XML</c> format of this object's state
        /// is written.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the <paramref name="reader"/> is <see langword="null"/>.
        /// </exception>
        public override void WriteXml(XmlWriter writer)
        {
            BuildExceptions.NotNull(writer, "writer");

            if (this.IsEmpty)
            {
                return;
            }

            writer.WriteStartElement(TagName);  // start - topic
            writer.WriteAttributeString("xamlSyntax", _xamlSyntax.ToString());

            writer.WriteStartElement("assembly"); // start - assembly
            if (_assembly != null)
            {
                _assembly.WriteXml(writer);
            }
            writer.WriteEndElement();             // end - assembly

            writer.WriteStartElement("comments"); // start - comments
            if (_comments != null)
            {
                _comments.WriteXml(writer);
            }
            writer.WriteEndElement();           // end - comments

            writer.WriteStartElement("source"); // start - source
            if (_source != null)
            {
                _source.WriteXml(writer);
            }
            writer.WriteEndElement();           // end - source

            writer.WriteEndElement();           // end - topic
        }
Esempio n. 4
0
        public override void WriteXml(XmlWriter writer)
        {
            BuildExceptions.NotNull(writer, "writer");

            //<topic id="2aca5da4-6f94-43a0-9817-5f413d16f100" type="topic" visible="True" revision="1">
            //    <title>Sandcastle For .NET</title>
            //    <path value="Sandcastle.aml">$(DXROOT)\SampleDir\Sandcastle.aml</path>
            //    <excludes>
            //        <exclude name="catId1"/>
            //        <exclude name="catId2"/>
            //    </excludes>
            //    <metadata>
            //        <keywords>
            //            <keyword type="K" value=""/>
            //        </keywords>
            //        <attributes>
            //            <attribute name="attrName1" value="attrValue1"/>
            //        </attributes>
            //    </metadata>
            //</topic>

            writer.WriteStartElement(TagName);  // topic
            writer.WriteAttributeString("id", _topicId);
            writer.WriteAttributeString("type", this.ItemType.ToString());
            writer.WriteAttributeString("visible", _isVisible.ToString());
            writer.WriteAttributeString("revision",
                                        this.TopicRevisions.ToString());

            writer.WriteElementString("title", _topicTitle);

            // Markers do not have file path...
            if (_filePath != null)
            {
                _filePath.WriteXml(writer);
            }

            this.OnWriteExcludes(writer);

            this.OnWriteMetadata(writer);

            this.OnWriteXmlTag(writer);

            for (int i = 0; i < this.ItemCount; i++)
            {
                this[i].WriteXml(writer);
            }

            writer.WriteEndElement();           // topic
        }
Esempio n. 5
0
        /// <summary>
        /// This writes the current state or attributes of this object,
        /// in the <c>XML</c> format, to the media or storage accessible by the given writer.
        /// </summary>
        /// <param name="writer">
        /// The <c>XML</c> writer with which the <c>XML</c> format of this object's state
        /// is written.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the <paramref name="reader"/> is <see langword="null"/>.
        /// </exception>
        public override void WriteXml(XmlWriter writer)
        {
            BuildExceptions.NotNull(writer, "writer");

            if (this.IsEmpty)
            {
                return;
            }

            writer.WriteStartElement(TagName);  // start - item
            writer.WriteAttributeString("name", _name);
            //writer.WriteAttributeString("strongName", _strongName);

            writer.WriteStartElement("location");     // start - location
            if (_path != null)
            {
                _path.WriteXml(writer);
            }
            writer.WriteEndElement();                 // end - location

            writer.WriteStartElement("redirection");  // start - redirection
            writer.WriteAttributeString("enabled", _isRedirected.ToString());
            if (!String.IsNullOrEmpty(_redirectPublicKeyToken))
            {
                writer.WriteAttributeString("publicKeyToken", _redirectPublicKeyToken);
            }
            if (_redirectVersion != null)
            {
                writer.WriteAttributeString("version", _redirectVersion.ToString());
            }
            if (_redirectCulture != null && !_redirectCulture.IsNeutralCulture)
            {
                writer.WriteAttributeString("culture", _redirectCulture.Name);
            }
            writer.WriteEndElement();           // end - redirection

            writer.WriteEndElement();           // end - item
        }
        /// <summary>
        /// This writes the current state or attributes of this object,
        /// in the <c>XML</c> format, to the media or storage accessible by the given writer.
        /// </summary>
        /// <param name="writer">
        /// The <c>XML</c> writer with which the <c>XML</c> format of this object's state
        /// is written.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the <paramref name="reader"/> is <see langword="null"/>.
        /// </exception>
        public override void WriteXml(XmlWriter writer)
        {
            BuildExceptions.NotNull(writer, "writer");

            if (!this.IsValid)
            {
                return;
            }

            writer.WriteStartElement(TagName);  // start - TagName
            writer.WriteAttributeString("name", this.Name);

            writer.WriteStartElement("propertyGroup");  // start - propertyGroup
            writer.WriteAttributeString("name", "General");
            writer.WritePropertyElement("Title", this.Title);
            writer.WriteEndElement();             // end - propertyGroup

            writer.WriteStartElement("location"); // start - location
            _sourcePath.WriteXml(writer);
            writer.WriteEndElement();             // end - location

            writer.WriteEndElement();             // end - TagName
        }