Example #1
0
        //=====================================================================

        /// <summary>
        /// This is used to save the topic information to the project file
        /// </summary>
        /// <param name="xw">The XML text writer to which the information is written</param>
        internal void WriteXml(XmlWriter xw)
        {
            xw.WriteStartElement("Topic");

            xw.WriteAttributeString("id", id.ToString());
            xw.WriteAttributeString("visible", "True");

            if (String.IsNullOrEmpty(body))
            {
                xw.WriteAttributeString("noFile", "True");
            }

            if (title != null)
            {
                xw.WriteAttributeString("title", title);
            }

            if (helpAttributes != null && helpAttributes.Count != 0)
            {
                helpAttributes.WriteXml(xw, true);
            }

            if (helpKeywords != null && helpKeywords.Count != 0)
            {
                helpKeywords.WriteXml(xw);
            }

            if (subtopics.Count != 0)
            {
                foreach (Topic t in subtopics)
                {
                    t.WriteXml(xw);
                }
            }

            xw.WriteEndElement();
        }
Example #2
0
        /// <summary>
        /// This is used to save the topic information to the project file
        /// </summary>
        /// <param name="xw">The XML text writer to which the information is written</param>
        internal void WriteXml(XmlWriter xw)
        {
            xw.WriteStartElement("Topic");

            if (topicFile != null)
            {
                xw.WriteAttributeString("id", topicFile.Id);
            }
            else
            if (contentId != null)
            {
                xw.WriteAttributeString("id", contentId);
            }

            xw.WriteAttributeString("visible", this.Visible.ToString(CultureInfo.InvariantCulture));

            if (noFile)
            {
                xw.WriteAttributeString("noFile", "true");
            }

            if (this.IsDefaultTopic)
            {
                xw.WriteAttributeString("isDefault", "true");
            }

            if (this.IsMSHVRootContentContainer)
            {
                xw.WriteAttributeString("isMSHVRoot", "true");
            }

            if (this.IsExpanded)
            {
                xw.WriteAttributeString("isExpanded", "true");
            }

            if (this.IsSelected)
            {
                xw.WriteAttributeString("isSelected", "true");
            }

            if (this.ApiParentMode != ApiParentMode.None)
            {
                xw.WriteAttributeString("apiParentMode", this.ApiParentMode.ToString());
            }

            if (title != null)
            {
                xw.WriteAttributeString("title", title);
            }

            if (tocTitle != null)
            {
                xw.WriteAttributeString("tocTitle", tocTitle);
            }

            if (linkText != null)
            {
                xw.WriteAttributeString("linkText", linkText);
            }

            if (helpAttributes.Count != 0)
            {
                helpAttributes.WriteXml(xw, true);
            }

            if (keywords.Count != 0)
            {
                keywords.WriteXml(xw);
            }

            if (subtopics.Count != 0)
            {
                foreach (Topic t in subtopics)
                {
                    t.WriteXml(xw);
                }
            }

            xw.WriteEndElement();
        }