/// <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("enabled", _isEnabled.ToString()); writer.WriteAttributeString("xamlSyntax", _xamlSyntax.ToString()); BuildFilePath.WriteLocation(_sourcePath, "location", writer); writer.WriteStartElement("includes"); // start - includes if (_includeSet != null && _includeSet.Count != 0) { foreach (string include in _includeSet) { writer.WriteStartElement("include"); // start - include writer.WriteAttributeString("name", include); writer.WriteEndElement(); // end - include } } writer.WriteEndElement(); // end - includes writer.WriteEndElement(); // end - item }
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); }
/// <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 }
/// <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 }
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 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); } }
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); }
/// <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; } } } }
/// <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); }
/// <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("InlineMathSize", _inlineSize); writer.WritePropertyElement("InlineMathZoom", _inlineZoom); writer.WritePropertyElement("DisplayedMathSize", _displayedSize); writer.WritePropertyElement("DisplayedMathZoom", _displayedZoom); writer.WritePropertyElement("InputPath", _inputPath); writer.WritePropertyElement("BaseOutput", _baseOutput); writer.WritePropertyElement("OutputPath", _outputPath); writer.WritePropertyElement("NamingPrefix", _namingPrefix); writer.WritePropertyElement("NamingMethod", _namingMethod.ToString()); writer.WritePropertyElement("NumberingEnabled", _numEnabled); writer.WritePropertyElement("NumberingByPage", _numByPage); writer.WritePropertyElement("NumberingFormatIncludesPage", _numFormatIncludesPage); writer.WritePropertyElement("NumberingFormat", _numFormat); writer.WriteEndElement(); // end - propertyGroup writer.WriteEndElement(); // end - TagName }
public StepCleanup(string workingDir, IList <string> deletePaths) : base(workingDir) { BuildExceptions.NotNull(deletePaths, "deletePaths"); _listPaths = deletePaths; }
/// <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 // Write the general properties writer.WriteStartElement("propertyGroup"); // start - propertyGroup; writer.WriteAttributeString("name", "General"); writer.WritePropertyElement("UseApiNode", _useApiNode); writer.WritePropertyElement("Verb", _verb); writer.WritePropertyElement("Value", _value); writer.WritePropertyElement("Attribute", _attribute); writer.WritePropertyElement("Condition", _condition); writer.WritePropertyElement("Expression", _expression); writer.WriteEndElement(); // end - propertyGroup writer.WriteStartElement("results"); // start - results; if (_results != null) { writer.WriteAttributeString("type", _results.GetType().ToString()); writer.WriteString(_results.ToString()); } writer.WriteEndElement(); // end - results 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); if (!this.IsEmpty) { if (!String.IsNullOrEmpty(_assemblyName)) { writer.WriteStartElement("assembly"); // start - assembly writer.WriteStartElement("name"); // start - name writer.WriteString(_assemblyName); writer.WriteEndElement(); // end - name writer.WriteEndElement(); // end - assembly } writer.WriteStartElement("members"); // start - members for (int i = 0; i < this.Count; i++) { this[i].WriteXml(writer); } writer.WriteEndElement(); // end - members } writer.WriteEndElement(); }
public virtual void Configure(BuildGroup buildGroup, string sourceFile, string destFile) { BuildExceptions.NotNull(buildGroup, "buildGroup"); BuildExceptions.PathMustExist(sourceFile, "sourceFile"); BuildExceptions.NotNullNotEmpty(destFile, "destFile"); if (this.IsInitialized == false) { throw new BuildException("The configurator is not initialized."); } if (_dicConfigMap == null || _configContent == null) { throw new BuildException("There is not initialization."); } _group = buildGroup; _sourceFile = sourceFile; _destFile = destFile; string destDir = Path.GetDirectoryName(destFile); if (Directory.Exists(destDir) == false) { Directory.CreateDirectory(destDir); } }
/// <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.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 }
/// <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"); 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 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 }
/// <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; } } }
/// <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 }
/// <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 }
public SnippetItem(BuildDirectoryPath source) : this() { BuildExceptions.NotNull(source, "source"); _source = source; }
/// <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.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 }
/// <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(); }
/// <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 }
/// <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 }
/// <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"); if (this.IsEmpty) { return; } writer.WriteStartElement(TagName); // start - TagName writer.WriteStartElement("propertyGroup"); // start - propertyGroup writer.WriteAttributeString("name", "General"); writer.WritePropertyElement("PlatformId", _platformId); writer.WritePropertyElement("PlatformTitle", _platformTitle); writer.WriteEndElement(); // end - propertyGroup writer.WriteStartElement("contentSources"); // start - contentSources if (_listSources != null && _listSources.Count != 0) { for (int i = 0; i < _listSources.Count; i++) { _listSources[i].WriteXml(writer); } } writer.WriteEndElement(); // end - contentSources writer.WriteEndElement(); // end - TagName }