private void ReadPropertyGroup(XmlReader reader)
        {
            string startElement = reader.Name;

            Debug.Assert(String.Equals(startElement, "propertyGroup"));
            Debug.Assert(String.Equals(reader.GetAttribute("name"), "General"));

            if (reader.IsEmptyElement)
            {
                return;
            }

            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (String.Equals(reader.Name, "property", StringComparison.OrdinalIgnoreCase))
                    {
                        string tempText = null;
                        switch (reader.GetAttribute("name").ToLower())
                        {
                        case "title":
                            this.Title = reader.ReadString();
                            break;

                        case "searchrecursive":
                            tempText = reader.ReadString();
                            if (!String.IsNullOrEmpty(tempText))
                            {
                                _isRecursive = Convert.ToBoolean(tempText);
                            }
                            break;

                        case "searchpattern":
                            _searchPattern = reader.ReadString();
                            break;

                        case "frameworktype":
                            tempText = reader.ReadString();
                            if (!String.IsNullOrEmpty(tempText))
                            {
                                _frameworkType = BuildFrameworkType.Parse(tempText);
                            }
                            break;

                        default:
                            // Should normally not reach here...
                            throw new NotImplementedException(reader.GetAttribute("name"));
                        }
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    if (String.Equals(reader.Name, startElement, StringComparison.OrdinalIgnoreCase))
                    {
                        break;
                    }
                }
            }
        }
Esempio n. 2
0
        private void ReadPropertyGroup(XmlReader reader)
        {
            string startElement = reader.Name;

            Debug.Assert(String.Equals(startElement, "propertyGroup"));
            Debug.Assert(String.Equals(reader.GetAttribute("name"), "General"));

            if (reader.IsEmptyElement)
            {
                return;
            }

            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (String.Equals(reader.Name, "property", StringComparison.OrdinalIgnoreCase))
                    {
                        switch (reader.GetAttribute("name").ToLower())
                        {
                        case "id":
                            _contentId = reader.ReadString();
                            break;

                        case "frameworktype":
                            string tempText = reader.ReadString();
                            if (!String.IsNullOrEmpty(tempText))
                            {
                                _frameworkType = (BuildFrameworkType)
                                                 BuildFrameworkType.Parse(tempText);
                            }
                            break;

                        default:
                            // Should normally not reach here...
                            throw new NotImplementedException(reader.GetAttribute("name"));
                        }
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    if (String.Equals(reader.Name, startElement, StringComparison.OrdinalIgnoreCase))
                    {
                        break;
                    }
                }
            }
        }