Пример #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");

            writer.WriteStartElement(TagName);  // start - styleOptions
            writer.WriteAttributeString("type", "Style");
            writer.WriteAttributeString("name", this.GetType().ToString());

            writer.WriteStartElement("propertyGroup");  // start - propertyGroup
            writer.WriteAttributeString("name", "General");
            writer.WritePropertyElement("StyleName", _styleName);
            writer.WritePropertyElement("StyleType", _styleType.ToString());
            writer.WriteEndElement();                   // end - propertyGroup

            BuildDirectoryPath.WriteLocation(_styleDir, "location", writer);
            BuildFilePath.WriteLocation(_stylePresentation, "presentation", writer);

            writer.WriteStartElement("contents");  // start - contents
            if (_scripts != null)
            {
                writer.WriteStartElement("content");
                writer.WriteAttributeString("type", "Scripts");
                _scripts.WriteXml(writer);
                writer.WriteEndElement();
            }
            if (_snippets != null)
            {
                writer.WriteStartElement("content");
                writer.WriteAttributeString("type", "Snippets");
                _snippets.WriteXml(writer);
                writer.WriteEndElement();
            }
            if (_styleSheets != null)
            {
                writer.WriteStartElement("content");
                writer.WriteAttributeString("type", "StyleSheets");
                _styleSheets.WriteXml(writer);
                writer.WriteEndElement();
            }
            if (_mathPackages != null)
            {
                writer.WriteStartElement("content");
                writer.WriteAttributeString("type", "Packages");
                _mathPackages.WriteXml(writer);
                writer.WriteEndElement();
            }
            if (_mathCommands != null)
            {
                writer.WriteStartElement("content");
                writer.WriteAttributeString("type", "Commands");
                _mathCommands.WriteXml(writer);
                writer.WriteEndElement();
            }
            writer.WriteEndElement();           // end - contents

            writer.WriteEndElement();           // end - styleOptions
        }
Пример #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");

            writer.WriteStartElement(TagName);  // start - feedbackOptions
            writer.WriteAttributeString("type", "Feedback");
            writer.WriteAttributeString("name", this.GetType().ToString());

            // Write the general properties
            writer.WriteStartElement("propertyGroup"); // start - propertyGroup;
            writer.WriteAttributeString("name", "General");
            writer.WritePropertyElement("FeedbackType", _feedbackType.ToString());
            writer.WritePropertyElement("CopyrightText", _copyrightText);
            writer.WritePropertyElement("CopyrightLink", _copyrightLink);
            writer.WritePropertyElement("ProductName", _productName);
            writer.WritePropertyElement("CompanyName", _companyName);
            writer.WritePropertyElement("EmailAddress", _emailAddress);
            writer.WritePropertyElement("PostalAddress", _postalAddress);
            writer.WriteEndElement();            // end - propertyGroup

            // Write the logo element
            writer.WriteStartElement("logo"); // start - logo
            writer.WriteAttributeString("enabled", _logoEnabled.ToString());
            writer.WriteAttributeString("alignment", _logoAlignment.ToString());
            writer.WriteAttributeString("placement", _logoPlacement.ToString());
            writer.WriteAttributeString("width", _logoWidth.ToString());
            writer.WriteAttributeString("height", _logoHeight.ToString());
            writer.WriteAttributeString("padding", _logoPadding.ToString());

            writer.WriteTextElement("text", _logoText);
            writer.WriteTextElement("link", _logoLink);

            BuildFilePath.WriteLocation(_logoImage, "image", writer);

            writer.WriteEndElement();         // end - logo

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