internal static ApplicationManifest ParseXml(XmlReader reader)
        {
            reader.MoveToContent();

            var node = new ApplicationManifest
            {
                AppPlatformVersion = reader.GetAttribute("AppPlatformVersion")
            };

            reader.ReadStartElement();

            while (reader.NodeType != XmlNodeType.EndElement)
            {
                switch (reader.Name)
                {
                case "DefaultLanguage":
                    node.DefaultLanguage = ApplicationManifestLanguageNode.ParseXml(reader);

                    break;

                case "AppExtra":
                    node.AppExtras = reader.ReadElementContentAsArray(ApplicationManifestNamedNode.ParseXml);

                    break;

                case "Languages":
                    node.Languages = reader.ReadElementContentAsArray(ApplicationManifestLanguageNode.ParseXml);

                    break;

                case "App":
                    node.App = ApplicationManifestAppNode.ParseXml(reader);

                    break;

                default:
                    reader.Skip();

                    break;
                }
            }

            reader.ReadEndElement();

            return(node);
        }
        internal static ApplicationManifestAppNode ParseXml(XmlReader reader)
        {
            var node = new ApplicationManifestAppNode()
            {
                Author       = reader.GetAttribute("Author"),
                BitsPerPixel = reader.GetAttribute("BitsPerPixel"),
                Description  = reader.GetAttribute("Description"),
                Genre        = reader.GetAttribute("Genre"),
                HasSettings  = reader.GetAttributeAsBool("HasSettings"),
                HubType      = reader.GetAttributeAsInt("HubType"),
                IsBeta       = reader.GetAttributeAsBool("IsBeta"),
                ProductId    = reader.GetAttribute("ProductID"),
                Publisher    = reader.GetAttribute("Publisher"),
                PublisherId  = reader.GetAttribute("PublisherID"),
                Title        = reader.GetAttribute("Title"),
                Version      = reader.GetAttribute("Version"),
            };

            reader.ReadStartElement();

            while (reader.NodeType != XmlNodeType.EndElement)
            {
                switch (reader.Name)
                {
                case "IconPath":
                    node.IconPath = ApplicationManifestIconPathNode.ParseXml(reader);

                    break;

                case "Capabilities":
                    node.Capabilities = reader.ReadElementContentAsArray(ApplicationManifestNamedNode.ParseXml);

                    break;

                case "ScreenResolutions":
                    node.ScreenResolutions = reader.ReadElementContentAsArray(ApplicationManifestNamedNode.ParseXml);

                    break;

                case "Requirements":
                    node.Requirements = reader.ReadElementContentAsArray(ApplicationManifestNamedNode.ParseXml);

                    break;

                case "Tasks":
                    node.Tasks = reader.ReadElementContentAsArray(ApplicationManifestTaskNodeBase.ParseXml);

                    break;

                case "Tokens":
                    node.Tokens = reader.ReadElementContentAsArray(ApplicationManifestTokenNode.ParseXml);

                    break;

                default:
                    reader.Skip();

                    break;
                }
            }

            reader.ReadEndElement();

            return(node);
        }
        internal static ApplicationManifestAppNode ParseXml(XmlReader reader)
        {
            var node = new ApplicationManifestAppNode()
            {
                Author = reader.GetAttribute("Author"),
                BitsPerPixel = reader.GetAttribute("BitsPerPixel"),
                Description = reader.GetAttribute("Description"),
                Genre = reader.GetAttribute("Genre"),
                HasSettings = reader.GetAttributeAsBool("HasSettings"),
                HubType = reader.GetAttributeAsInt("HubType"),
                IsBeta = reader.GetAttributeAsBool("IsBeta"),
                ProductId = reader.GetAttribute("ProductID"),
                Publisher = reader.GetAttribute("Publisher"),
                PublisherId = reader.GetAttribute("PublisherID"),
                Title = reader.GetAttribute("Title"),
                Version = reader.GetAttribute("Version"),
            };

            reader.ReadStartElement();

            while (reader.NodeType != XmlNodeType.EndElement)
            {
                switch (reader.Name)
                {
                    case "IconPath":
                        node.IconPath = ApplicationManifestIconPathNode.ParseXml(reader);

                        break;

                    case "Capabilities":
                        node.Capabilities = reader.ReadElementContentAsArray(ApplicationManifestNamedNode.ParseXml);

                        break;

                    case "ScreenResolutions":
                        node.ScreenResolutions = reader.ReadElementContentAsArray(ApplicationManifestNamedNode.ParseXml);

                        break;

                    case "Requirements":
                        node.Requirements = reader.ReadElementContentAsArray(ApplicationManifestNamedNode.ParseXml);

                        break;

                    case "Tasks":
                        node.Tasks = reader.ReadElementContentAsArray(ApplicationManifestTaskNodeBase.ParseXml);

                        break;

                    case "Tokens":
                        node.Tokens = reader.ReadElementContentAsArray(ApplicationManifestTokenNode.ParseXml);

                        break;

                    default:
                        reader.Skip();

                        break;
                }
            }

            reader.ReadEndElement();

            return node;
        }