Exemple #1
0
        public SharedItem(string key, string value)
        {
            BuildExceptions.NotNullNotEmpty(key, "key");

            _id    = key;
            _value = value;
        }
Exemple #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 - TagName
            writer.WriteAttributeString("name", ConfigurationName);

            // Write the general properties
            writer.WriteStartElement("propertyGroup"); // start - propertyGroup;
            writer.WriteAttributeString("name", "General");
            writer.WritePropertyElement("Enabled", this.Enabled);
            writer.WritePropertyElement("ContinueOnError", this.ContinueOnError);
            writer.WritePropertyElement("Log", _log);
            writer.WritePropertyElement("LogXml", _logXml);
            writer.WritePropertyElement("LogFilePrefix", _logFilePrefix);
            writer.WritePropertyElement("SpellChecker", _spellChecker);
            writer.WriteEndElement();             // end - propertyGroup

            writer.WriteStartElement("skipTags"); // start - skipTags;
            if (_skipTags != null && _skipTags.Count != 0)
            {
                foreach (string tag in _skipTags)
                {
                    if (!String.IsNullOrEmpty(tag))
                    {
                        writer.WriteTextElement("skipTag", tag);
                    }
                }
            }
            writer.WriteEndElement();           // end - skipTags

            writer.WriteEndElement();           // end - TagName
        }
Exemple #3
0
        public RuleItem(string name, string value)
        {
            BuildExceptions.NotNullNotEmpty(name, "name");

            _name  = name;
            _value = value;
        }
Exemple #4
0
        public virtual void Initialize(BuildContext context, ConceptualGroup group)
        {
            BuildExceptions.NotNull(context, "context");
            BuildExceptions.NotNull(group, "group");

            if (_isInitialized)
            {
                return;
            }

            _context = context;
            _group   = group;

            if (_engineSettings == null)
            {
                BuildSettings settings = context.Settings;
                Debug.Assert(settings != null,
                             "The settings is not associated with the context.");
                if (settings == null)
                {
                    return;
                }
                _engineSettings = (ConceptualEngineSettings)settings.EngineSettings[
                    BuildEngineType.Conceptual];
                Debug.Assert(_engineSettings != null,
                             "The settings does not include the conceptual engine settings.");
                if (_engineSettings == null)
                {
                    return;
                }
            }

            _isInitialized = true;
        }
        public override void WriteAssembler(XmlWriter writer)
        {
            BuildExceptions.NotNull(writer, "writer");
            if (!this.IsInitialized)
            {
                throw new InvalidOperationException(
                          "The format assembler is not initialized.");
            }

            // 1. Resolve conceptual art/media links
            this.WriteResolveArtLinks(writer);

            // 2. Resolve shared contents
            this.WriteSharedContent(writer);

            // 3. For the conceptual links...
            this.WriteResolveConceptualLinks(writer);

            // 4. For the reference links...
            this.WriteResolveReferenceLinks(writer);

            // 5. For the Microsoft Help Viewer...
            if (this.Format.FormatType == BuildFormatType.HtmlHelp3)
            {
                this.WriteMshc(writer);
            }

            // 6. For saving the results...
            this.WriteSaveOutput(writer);
        }
Exemple #6
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 - TemplateItemGroup
            if (_frameworkType != TemplateFrameworkType.None)
            {
                writer.WriteAttributeString("FrameworkType", _frameworkType.ToString());
            }
            if (!String.IsNullOrEmpty(_condition))
            {
                writer.WriteAttributeString("Condition", _condition);
            }
            if (_properties != null && _properties.Count != 0)
            {
                foreach (KeyValuePair <string, string> pair in _properties)
                {
                    if (!String.IsNullOrEmpty(pair.Key) && !String.IsNullOrEmpty(pair.Value))
                    {
                        writer.WriteTextElement(pair.Key, pair.Value);
                    }
                }
            }
            writer.WriteEndElement();           // end - TemplateItemGroup
        }
Exemple #7
0
        public SnippetItem(string source)
            : this()
        {
            BuildExceptions.PathMustExist(source, "source");

            _source = new BuildDirectoryPath(source);
        }
Exemple #8
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 - TagName
            writer.WriteAttributeString("name", ConfigurationName);

            // Write the general properties
            writer.WriteStartElement("propertyGroup"); // start - propertyGroup;
            writer.WriteAttributeString("name", "General");
            writer.WritePropertyElement("Enabled", this.Enabled);
            writer.WriteEndElement();                  // end - propertyGroup

            BuildDirectoryPath.WriteLocation(_workingDir, "workingDirectory",
                                             writer);

            // Write out the expressions
            writer.WriteStartElement("expressions"); // start - expressions
            WriteExpression(writer, "Root", _rootExpression);
            WriteExpression(writer, "Assembly", _assemblyExpression);
            WriteExpression(writer, "Summary", _summaryExpression);
            WriteExpression(writer, "Parameters", _parametersExpression);
            WriteExpression(writer, "ParameterContent", _parameterContentExpression);
            WriteExpression(writer, "Templates", _templatesExpression);
            WriteExpression(writer, "TemplateContent", _templateContentExpression);
            WriteExpression(writer, "Returns", _returnsExpression);
            WriteExpression(writer, "Exception", _exceptionExpression);
            WriteExpression(writer, "ExceptionCref", _exceptionCrefExpression);
            WriteExpression(writer, "Enumeration", _enumerationExpression);
            WriteExpression(writer, "EnumerationApi", _enumerationApiExpression);
            WriteExpression(writer, "MemberSummary", _memberSummaryExpression);
            writer.WriteEndElement();           // end - expressions

            writer.WriteEndElement();           // end - TagName
        }
        /// <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 - TemplateAssistant
            writer.WriteAttributeString("FullClassName", _fullClassName);

            writer.WriteStartElement("Assembly");               // start - Assembly
            writer.WriteAttributeString("Path", _assemblyPath);
            writer.WriteString(_assemblyName);
            writer.WriteEndElement();                           // end - Assembly

            if (!String.IsNullOrEmpty(_data))
            {
                writer.WriteStartElement("Data");  // start - Data
                writer.WriteCData(_data);
                writer.WriteEndElement();          // end - Data
            }

            writer.WriteEndElement();           // end - TemplateAssistant
        }
        /// <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 - TemplateAction

            if (_arguments != null && _arguments.Count != 0)
            {
                // We write the "Name" first...
                writer.WriteAttributeString("Name", _arguments["Name"]);

                foreach (KeyValuePair <string, string> pair in _arguments)
                {
                    // ...then write all other attributes as arguments...
                    if (!String.Equals(pair.Key, "Name", StringComparison.OrdinalIgnoreCase))
                    {
                        writer.WriteAttributeString(pair.Key, pair.Value);
                    }
                }
            }

            writer.WriteEndElement();           // end - TemplateAction
        }
        /// <summary>
        /// This reads and sets its state or attributes stored in a <c>XML</c> format
        /// with the given reader.
        /// </summary>
        /// <param name="reader">
        /// The reader with which the <c>XML</c> attributes of this object are accessed.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the <paramref name="reader"/> is <see langword="null"/>.
        /// </exception>
        public override void ReadXml(XmlReader reader)
        {
            BuildExceptions.NotNull(reader, "reader");

            Debug.Assert(reader.NodeType == XmlNodeType.Element);
            if (reader.NodeType != XmlNodeType.Element)
            {
                return;
            }

            if (!String.Equals(reader.Name, TagName,
                               StringComparison.OrdinalIgnoreCase))
            {
                return;
            }

            if (_arguments == null || _arguments.Count != 0)
            {
                _arguments = new BuildProperties();
            }
            if (reader.HasAttributes)
            {
                while (reader.MoveToNextAttribute())
                {
                    _arguments[reader.Name] = reader.Value;
                }
            }
        }
Exemple #12
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
        }
Exemple #13
0
        /// <summary>
        /// The creates the configuration information or settings required by the
        /// target component for the build process.
        /// </summary>
        /// <param name="group">
        /// A build group, <see cref="BuildGroup"/>, representing the documentation
        /// target for configuration.
        /// </param>
        /// <param name="writer">
        /// An <see cref="XmlWriter"/> object used to create one or more new
        /// child nodes at the end of the list of child nodes of the current node.
        /// </param>
        /// <returns>
        /// Returns <see langword="true"/> for a successful configuration;
        /// otherwise, it returns <see langword="false"/>.
        /// </returns>
        /// <remarks>
        /// The <see cref="XmlWriter"/> writer passed to this configuration object
        /// may be passed on to other configuration objects, so do not close or
        /// dispose it.
        /// </remarks>
        public override bool Configure(BuildGroup group, XmlWriter writer)
        {
            BuildExceptions.NotNull(group, "group");
            BuildExceptions.NotNull(writer, "writer");

            if (!this.Enabled || !this.IsInitialized)
            {
                return(false);
            }

            string outputDir = "Intellisense";

            if (String.IsNullOrEmpty(_workingDir))
            {
                outputDir = Path.Combine(_outputDir, outputDir);
            }
            else
            {
                outputDir = _workingDir;
            }
            if (!Directory.Exists(outputDir))
            {
                Directory.CreateDirectory(outputDir);
            }

            writer.WriteStartElement("output");  //start: output
            writer.WriteAttributeString("directory", outputDir);
            writer.WriteEndElement();            //end: output

            return(true);
        }
Exemple #14
0
        /// <summary>
        /// This reads and sets its state or attributes stored in a <c>XML</c> format
        /// with the given reader.
        /// </summary>
        /// <param name="reader">
        /// The reader with which the <c>XML</c> attributes of this object are accessed.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If the <paramref name="reader"/> is <see langword="null"/>.
        /// </exception>
        public override void ReadXml(XmlReader reader)
        {
            BuildExceptions.NotNull(reader, "reader");

            Debug.Assert(reader.NodeType == XmlNodeType.Element);
            if (reader.NodeType != XmlNodeType.Element)
            {
                return;
            }

            if (!String.Equals(reader.Name, TagName,
                               StringComparison.OrdinalIgnoreCase))
            {
                Debug.Assert(false, String.Format(
                                 "The element name '{0}' does not match the expected '{1}'.",
                                 reader.Name, TagName));
                return;
            }

            if (reader.IsEmptyElement)
            {
                return;
            }

            this.Clear();

            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (String.Equals(reader.Name, HierarchicalTocItem.TagName,
                                      StringComparison.OrdinalIgnoreCase))
                    {
                        HierarchicalTocItem item = new HierarchicalTocItem();
                        item.Content = this;
                        item.ReadXml(reader);

                        this.Add(item);
                    }
                    else if (String.Equals(reader.Name, HierarchicalTocNode.TagName,
                                           StringComparison.OrdinalIgnoreCase))
                    {
                        if (_rootNode == null)
                        {
                            _rootNode = new HierarchicalTocNode();
                        }

                        _rootNode.ReadXml(reader);
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    if (String.Equals(reader.Name, TagName,
                                      StringComparison.OrdinalIgnoreCase))
                    {
                        break;
                    }
                }
            }
        }
Exemple #15
0
        public override ReferenceContent Create(BuildGroupContext groupContext)
        {
            BuildExceptions.NotNull(groupContext, "groupContext");

            BuildContext context = groupContext.Context;
            BuildLogger  logger  = null;

            if (context != null)
            {
                logger = context.Logger;
            }

            if (!this.IsInitialized)
            {
                throw new BuildException(String.Format(
                                             "The content source '{0}' is not yet initialized.", this.Title));
            }
            if (!this.IsValid)
            {
                if (logger != null)
                {
                    logger.WriteLine(String.Format(
                                         "The content group source '{0}' is invalid.", this.Title),
                                     BuildLoggerLevel.Warn);
                }

                return(null);
            }

            return(_content);
        }
Exemple #16
0
        public CategoryItem(string name, string description)
        {
            BuildExceptions.NotNullNotEmpty(name, "name");

            _name        = name;
            _description = description;
        }
        OnCreateConfiguration(string name, bool isPlugin)
        {
            BuildExceptions.NotNullNotEmpty(name, "name");

            switch (name.ToLower())
            {
            case "sandcastle.references.referencecommentconfiguration":
                return(new ReferenceCommentConfiguration());

            case "sandcastle.references.referencespellcheckconfiguration":
                return(new ReferenceSpellCheckConfiguration());

            case "sandcastle.references.referencevisibilityconfiguration":
                return(new ReferenceVisibilityConfiguration());

            case "sandcastle.references.referencexpathconfiguration":
                return(new ReferenceXPathConfiguration());

            case "sandcastle.references.referencetocexcludeconfiguration":
                return(new ReferenceTocExcludeConfiguration());

            case "sandcastle.references.referencetoclayoutconfiguration":
                return(new ReferenceTocLayoutConfiguration());
            }

            return(base.OnCreateConfiguration(name, isPlugin));
        }
        /// <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);

            if (!this.IsEmpty)
            {
                writer.WriteStartElement("paths");    // start: paths
                for (int i = 0; i < _paths.Count; i++)
                {
                    _paths[i].WriteXml(writer);
                }
                writer.WriteEndElement();             // end: paths

                writer.WriteStartElement("items");    // start: items
                for (int i = 0; i < this.Count; i++)
                {
                    this[i].WriteXml(writer);
                }
                writer.WriteEndElement();             // end: items
            }

            writer.WriteEndElement();
        }
Exemple #19
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("id", _tocId);

            writer.WriteStartElement("source"); // start - source
            writer.WriteAttributeString("id", _sourceId);
            writer.WriteAttributeString("type", _sourceType.ToString());
            writer.WriteAttributeString("recursive", _isRecursive.ToString());
            writer.WriteEndElement();           // end - source

            if (_listItems != null && _listItems.Count != 0)
            {
                for (int i = 0; i < _listItems.Count; i++)
                {
                    _listItems[i].WriteXml(writer);
                }
            }

            writer.WriteEndElement();           // end - item
        }
Exemple #20
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
        }
Exemple #21
0
        public SnippetItem(BuildDirectoryPath source)
            : this()
        {
            BuildExceptions.NotNull(source, "source");

            _source = source;
        }
        /// <summary>
        /// The creates the configuration information or settings required by the
        /// target component for the build process.
        /// </summary>
        /// <param name="group">
        /// A build group, <see cref="BuildGroup"/>, representing the documentation
        /// target for configuration.
        /// </param>
        /// <param name="writer">
        /// An <see cref="XmlWriter"/> object used to create one or more new
        /// child nodes at the end of the list of child nodes of the current node.
        /// </param>
        /// <returns>
        /// Returns <see langword="true"/> for a successful configuration;
        /// otherwise, it returns <see langword="false"/>.
        /// </returns>
        /// <remarks>
        /// The <see cref="XmlWriter"/> writer passed to this configuration object
        /// may be passed on to other configuration objects, so do not close or
        /// dispose it.
        /// </remarks>
        public override bool Configure(BuildGroup group, XmlWriter writer)
        {
            BuildExceptions.NotNull(group, "group");
            BuildExceptions.NotNull(writer, "writer");

            if (!this.Enabled || !this.IsInitialized)
            {
                return(false);
            }

            BuildGroupContext groupContext = _context.GroupContexts[group.Id];

            if (groupContext == null)
            {
                throw new BuildException(
                          "The group context is not provided, and it is required by the build system.");
            }

            // <autoDocument enabled="true" warn="true" constructors="true"
            //   disposeMethods="true"/>
            // Or
            //<autoDocument enabled="true" warn="true">
            //    <constructors enabled="true">
            //        <normalSummary comment=""/>
            //        <staticSummary comment=""/>
            //    </constructors>
            //    <disposeMethods enabled="true">
            //        <withoutParamSummary comment=""/>
            //        <withParamSummary comment=""/>
            //        <boolParam comment=""/>
            //    </disposeMethods>
            //</autoDocument>

            bool   notApplicable = false;
            string embeddedText  = groupContext["$IsEmbeddedGroup"];

            if (!String.IsNullOrEmpty(embeddedText) &&
                embeddedText.Equals(Boolean.TrueString, StringComparison.OrdinalIgnoreCase))
            {
                notApplicable = true;
            }

            writer.WriteComment(" Start: Automatic documentation options ");
            writer.WriteStartElement("autoDocument");   //start: autoDocument
            if (notApplicable)
            {
                writer.WriteAttributeString("enabled", "false");
            }
            else
            {
                writer.WriteAttributeString("enabled", this.Enabled.ToString());
            }
            writer.WriteAttributeString("warn", _warn.ToString());
            writer.WriteAttributeString("constructors", _constructors.ToString());
            writer.WriteAttributeString("disposeMethods", _disposeMethods.ToString());
            writer.WriteEndElement();                   //end: autoDocument
            writer.WriteComment(" End: Automatic documentation options ");

            return(true);
        }
        /// <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("Id", this.Id);
            writer.WritePropertyElement("Title", this.Title);
            writer.WritePropertyElement("Enabled", this.Enabled);
            writer.WritePropertyElement("IncludesSettings", this.IncludesSettings);
            writer.WritePropertyElement("IncludesConceptuals", this.IncludesConceptuals);
            writer.WritePropertyElement("IncludesReferences", this.IncludesReferences);
            writer.WriteEndElement();                   // end - propertyGroup

            writer.WriteStartElement("importSources");  // start - importSources
            if (_listImports != null && _listImports.Count != 0)
            {
                for (int i = 0; i < _listImports.Count; i++)
                {
                    BuildFilePath.WriteLocation(_listImports[i],
                                                "importSource", writer);
                }
            }
            writer.WriteEndElement();           // end - importSources

            writer.WriteEndElement();           // end - TagName
        }
Exemple #24
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
        }
        /// <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 - TagName
            writer.WriteAttributeString("name", ConfigurationName);

            // Write the general properties
            writer.WriteStartElement("propertyGroup"); // start - propertyGroup;
            writer.WriteAttributeString("name", "General");
            writer.WritePropertyElement("Enabled", this.Enabled);
            writer.WritePropertyElement("ContinueOnError", this.ContinueOnError);
            writer.WriteEndElement();                // end - propertyGroup

            writer.WriteStartElement("xpathItems");  // start - xpathItems
            if (_xpathExpressions != null && _xpathExpressions.Count != 0)
            {
                for (int i = 0; i < _xpathExpressions.Count; i++)
                {
                    _xpathExpressions[i].WriteXml(writer);
                }
            }
            writer.WriteEndElement();           // end - xpathItems

            writer.WriteEndElement();           // end - TagName
        }
Exemple #26
0
        public override void Visit(ReferenceDocument referenceDocument)
        {
            BuildExceptions.NotNull(referenceDocument, "referenceDocument");
            if (referenceDocument.DocumentType != ReferenceDocumentType.Reflection)
            {
                return;
            }

            XmlDocument xmlDocument = referenceDocument.Document;

            if (xmlDocument == null)
            {
                return;
            }
            if (_visibility == null || !_visibility.Enabled || _notApplicable)
            {
                return;
            }

            XPathNavigator documentNavigator = xmlDocument.CreateNavigator();
            XPathNavigator rootNavigator     = documentNavigator.SelectSingleNode(
                "reflection/apis");

            if (rootNavigator != null)
            {
                this.ApplyVisibility(rootNavigator);
            }
        }
Exemple #27
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public override void ReadXml(XmlReader reader)
        {
            BuildExceptions.NotNull(reader, "reader");

            Debug.Assert(reader.NodeType == XmlNodeType.Element);

            if (reader.NodeType != XmlNodeType.Element)
            {
                return;
            }
            if (!String.Equals(reader.Name, TagName,
                               StringComparison.OrdinalIgnoreCase))
            {
                return;
            }

            string nodeText = reader.GetAttribute("name");

            if (!String.IsNullOrEmpty(nodeText))
            {
                this.Name = nodeText;
            }
            nodeText = reader.GetAttribute("expose");
            if (!String.IsNullOrEmpty(nodeText))
            {
                this.Expose = Convert.ToBoolean(nodeText);
            }
        }
        /// <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 - TagName
            writer.WriteAttributeString("name", ConfigurationName);

            // Write the general properties
            writer.WriteStartElement("propertyGroup"); // start - propertyGroup;
            writer.WriteAttributeString("name", "General");
            writer.WritePropertyElement("Enabled", this.Enabled);
            writer.WritePropertyElement("Log", _log);
            writer.WritePropertyElement("LogXml", _logXml);
            writer.WritePropertyElement("Warn", _warn);
            writer.WritePropertyElement("Indicate", _indicate);
            writer.WritePropertyElement("RootTags", _rootTags);
            writer.WritePropertyElement("ExceptionTags", _exceptionTags);
            writer.WritePropertyElement("IncludeTargetTags", _includeTargetTags);
            writer.WritePropertyElement("NamespaceTags", _namespaceTags);
            writer.WritePropertyElement("ParameterTags", _parameterTags);
            writer.WritePropertyElement("RemarkTags", _remarkTags);
            writer.WritePropertyElement("ReturnTags", _returnTags);
            writer.WritePropertyElement("SummaryTags", _summaryTags);
            writer.WritePropertyElement("TypeParameterTags", _typeParameterTags);
            writer.WritePropertyElement("ValueTags", _valueTags);
            writer.WriteEndElement();           // end - propertyGroup

            writer.WriteEndElement();           // end - TagName
        }
Exemple #29
0
        public void Import(string contentFile)
        {
            BuildExceptions.NotNullNotEmpty(contentFile, "contentFile");

            XmlReader reader = null;

            try
            {
                XmlReaderSettings settings = new XmlReaderSettings();

                settings.IgnoreComments               = true;
                settings.IgnoreWhitespace             = true;
                settings.IgnoreProcessingInstructions = true;

                reader = XmlReader.Create(contentFile, settings);

                reader.MoveToContent();

                this.ImportXml(reader);

                _isLoaded = true;
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                    reader = null;
                }
            }
        }
Exemple #30
0
        public TokenContent(string contentFile)
            : this()
        {
            BuildExceptions.PathMustExist(contentFile, "contentFile");

            _contentFile = new BuildFilePath(contentFile);
        }