internal void Read(XmlReader reader) { while (reader.Read()) { // Look for the end element. if (reader.NodeType == XmlNodeType.EndElement && AppConfig.StringEquals(reader.Name, "runtime")) { return; } // Look for a <dependentAssembly> element if (reader.NodeType == XmlNodeType.Element && AppConfig.StringEquals(reader.Name, "dependentAssembly")) { var dependentAssembly = new DependentAssembly(); dependentAssembly.Read(reader); // Only add if there was an <assemblyIdentity> tag. // Otherwise, this section is no use. if (dependentAssembly.PartialAssemblyName != null) { DependentAssemblies.Add(dependentAssembly); } } } }
/// <summary> /// The reader is positioned on a <runtime> element--read it. /// </summary> /// <param name="reader"></param> internal void Read(XmlTextReader reader) { while (reader.Read()) { // Look for the end element. if (reader.NodeType == XmlNodeType.EndElement && AppConfig.StringEquals(reader.Name, "runtime")) { return; } // Look for a <dependentAssembly> element if (reader.NodeType == XmlNodeType.Element && AppConfig.StringEquals(reader.Name, "dependentAssembly")) { DependentAssembly dependentAssembly = new DependentAssembly(); dependentAssembly.Read(reader); // Only add if there was an <assemblyIdentity> tag. // Otherwise, this section is no use. if (dependentAssembly.PartialAssemblyName != null) { _dependentAssemblies.Add(dependentAssembly); } } } }
public void SerializeDeserialize() { DependentAssembly dependentAssembly = new DependentAssembly(); string xml = "<assemblyIdentity name='ClassLibrary1'/>"; dependentAssembly.Read(new XmlTextReader(xml, XmlNodeType.Document, null)); Assert.IsTrue(dependentAssembly.PartialAssemblyName != null); }
internal void Read(XmlTextReader reader) { while (reader.Read()) { if ((reader.NodeType == XmlNodeType.EndElement) && AppConfig.StringEquals(reader.Name, "runtime")) { return; } if ((reader.NodeType == XmlNodeType.Element) && AppConfig.StringEquals(reader.Name, "dependentAssembly")) { DependentAssembly assembly = new DependentAssembly(); assembly.Read(reader); if (assembly.PartialAssemblyName != null) { this.dependentAssemblies.Add(assembly); } } } }
internal void Read(XmlTextReader reader) { while (reader.Read()) { if ((reader.NodeType == XmlNodeType.EndElement) && AppConfig.StringEquals(reader.Name, "runtime")) { return; } if ((reader.NodeType == XmlNodeType.Element) && AppConfig.StringEquals(reader.Name, "dependentAssembly")) { DependentAssembly assembly = new DependentAssembly(); assembly.Read(reader); if (assembly.PartialAssemblyName != null) { this.dependentAssemblies.Add(assembly); } } } }