/// <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; } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { if (String.Equals(reader.Name, "propertyGroup", StringComparison.OrdinalIgnoreCase)) { this.ReadPropertyGroup(reader); } else if (String.Equals(reader.Name, "location", StringComparison.OrdinalIgnoreCase)) { _sourcePath = BuildFilePath.ReadLocation(reader); } else if (String.Equals(reader.Name, "contents", StringComparison.OrdinalIgnoreCase)) { this.ReadContents(reader); } else if (String.Equals(reader.Name, "filters", StringComparison.OrdinalIgnoreCase)) { this.ReadFilters(reader); } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { break; } } } }
/// <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; } string nodeText = reader.GetAttribute("xamlSyntax"); if (!String.IsNullOrEmpty(nodeText)) { _xamlSyntax = Convert.ToBoolean(nodeText); } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { if (String.Equals(reader.Name, "assembly", StringComparison.OrdinalIgnoreCase) && !reader.IsEmptyElement) { _assembly = BuildFilePath.ReadLocation(reader); } else if (String.Equals(reader.Name, "comments", StringComparison.OrdinalIgnoreCase) && !reader.IsEmptyElement) { _comments = BuildFilePath.ReadLocation(reader); } else if (String.Equals(reader.Name, "source", StringComparison.OrdinalIgnoreCase) && !reader.IsEmptyElement) { _source = BuildFilePath.ReadLocation(reader); } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { break; } } } }
/// <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; } _name = reader.GetAttribute("name"); if (reader.IsEmptyElement) { return; } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { switch (reader.Name.ToLower()) { case "description": _description = reader.ReadString(); break; case "tag": _tag = reader.ReadString(); break; case "transformFile": _transformFile = BuildFilePath.ReadLocation(reader); break; } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { break; } } } }
protected override void OnReadXml(XmlReader reader) { if (reader.IsEmptyElement) { return; } if (String.Equals(reader.Name, "compilerFile", StringComparison.OrdinalIgnoreCase)) { _compilerFile = BuildFilePath.ReadLocation(reader); } }
/// <summary> /// /// </summary> /// <param name="reader"></param> private void ReadImportSources(XmlReader reader) { string startElement = reader.Name; Debug.Assert(String.Equals(startElement, "importSources")); Debug.Assert(String.Equals(reader.GetAttribute("name"), this.Name)); if (reader.IsEmptyElement) { return; } if (_listImports == null || _listImports.Count != 0) { _listImports = new BuildList <BuildFilePath>(); } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { if (String.Equals(reader.Name, "importSource", StringComparison.OrdinalIgnoreCase)) { BuildFilePath filePath = BuildFilePath.ReadLocation(reader); if (filePath != null && filePath.IsValid) { _listImports.Add(filePath); } } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, startElement, StringComparison.OrdinalIgnoreCase)) { break; } } } }
/// <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; } _name = reader.GetAttribute("name"); string tempText = reader.GetAttribute("overrides"); if (!String.IsNullOrEmpty(tempText)) { _overrides = Convert.ToBoolean(tempText); } if (reader.IsEmptyElement) { return; } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { switch (reader.Name.ToLower()) { case "tag": _tag = reader.ReadString(); break; case "condition": _condition = reader.ReadString(); break; case "description": _description = reader.ReadString(); break; case "location": _scriptFile = BuildFilePath.ReadLocation(reader); break; } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { break; } } } }
protected override void OnReadXml(XmlReader reader) { if (reader.IsEmptyElement) { return; } if (String.Equals(reader.Name, "compilerFile", StringComparison.OrdinalIgnoreCase)) { _compilerFile = BuildFilePath.ReadLocation(reader); } else if (String.Equals(reader.Name, "compilerDirectory", StringComparison.OrdinalIgnoreCase)) { _compilerDir = BuildDirectoryPath.ReadLocation(reader); } else if (String.Equals(reader.Name, "plugin", StringComparison.OrdinalIgnoreCase)) { //<plugin flatToc="False"> // <title></title> // <parents> // <parent>ParentName</parent> // </parents> // <children> // <child>ChildName</child> // </children> //</plugin> if (_pluginParents == null) { _pluginParents = new BuildList <string>(); } if (_pluginChildren == null) { _pluginChildren = new BuildList <string>(); } string tempText = reader.GetAttribute("flatToc"); if (!String.IsNullOrEmpty(tempText)) { _pluginTocFlat = Convert.ToBoolean(tempText); } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { switch (reader.Name.ToLower()) { case "title": _pluginTitle = reader.ReadString(); break; case "parent": tempText = reader.ReadString(); if (!String.IsNullOrEmpty(tempText)) { _pluginParents.Add(tempText); } break; case "child": tempText = reader.ReadString(); if (!String.IsNullOrEmpty(tempText)) { _pluginChildren.Add(tempText); } break; } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, "plugin", StringComparison.OrdinalIgnoreCase)) { break; } } } } }
/// <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; } string tempText = reader.GetAttribute("enabled"); if (!String.IsNullOrEmpty(tempText)) { _isEnabled = Convert.ToBoolean(tempText); } tempText = reader.GetAttribute("xamlSyntax"); if (!String.IsNullOrEmpty(tempText)) { _xamlSyntax = Convert.ToBoolean(tempText); } if (reader.IsEmptyElement) { return; } if (_includeSet == null || _includeSet.Count != 0) { _includeSet = new HashSet <string>(StringComparer.OrdinalIgnoreCase); } while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { if (String.Equals(reader.Name, "location", StringComparison.OrdinalIgnoreCase)) { _sourcePath = BuildFilePath.ReadLocation(reader); } else if (String.Equals(reader.Name, "include", StringComparison.OrdinalIgnoreCase)) { tempText = reader.GetAttribute("name"); if (!String.IsNullOrEmpty(tempText)) { this.AddInclude(tempText); } } } else if (reader.NodeType == XmlNodeType.EndElement) { if (String.Equals(reader.Name, TagName, StringComparison.OrdinalIgnoreCase)) { break; } } } }