Exemple #1
0
        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);
        }
Exemple #2
0
        private FileDependency ReadFileDependency(XmlReader reader)
        {
            MoveToElement(reader, FileDependencyElementName);

            string name = string.Empty;

            //Read Element attributes
            while (reader.MoveToNextAttribute())
            {
                switch (reader.Name)
                {
                case SolutionNameAttributeName:
                    name = reader.ReadContentAsString();
                    break;
                }
            }

            //Move back to Element
            reader.MoveToElement();

            FileDependency fileDependency = new FileDependency(name);

            return(fileDependency);
        }