private void ReadDependencies(XmlReader reader, List <SolutionDependency> dependencies) { MoveToElement(reader, DependenciesElementName); //Read Element content while (reader.Read()) { if (reader.NodeType == XmlNodeType.EndElement && string.Equals(DependenciesElementName, reader.Name)) { break; } if (reader.NodeType != XmlNodeType.Element) { continue; } switch (reader.Name) { case SolutionDependencyElementName: SolutionDependency solutionDependency = ReadSolutionDependency(reader); dependencies.Add(solutionDependency); break; } } }
private SolutionDependency ReadSolutionDependency(XmlReader reader) { MoveToElement(reader, SolutionDependencyElementName); string name = string.Empty; List <FileDependency> dependencies = new List <FileDependency>(); //Read Element attributes while (reader.MoveToNextAttribute()) { switch (reader.Name) { case SolutionNameAttributeName: name = reader.ReadContentAsString(); break; } } //Move back to Element reader.MoveToElement(); //Read Element content while (reader.Read()) { if (reader.NodeType == XmlNodeType.EndElement && string.Equals(SolutionDependencyElementName, reader.Name)) { break; } if (reader.NodeType != XmlNodeType.Element) { continue; } switch (reader.Name) { case FileDependencyElementName: FileDependency fileDependency = ReadFileDependency(reader); dependencies.Add(fileDependency); break; } } SolutionDependency solutionDependency = new SolutionDependency(name, dependencies); return(solutionDependency); }