Represents the contents of the application manifest.
        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 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;
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MainViewModel"/> class.
 /// </summary>
 /// <param name="emailComposeService">
 /// The email Compose Service.
 /// </param>
 /// <param name="applicationManifestService">
 /// The application Manifest Service.
 /// </param>
 /// <param name="marketplaceReviewService">
 /// The marketplace review service
 /// </param>
 /// <param name="shareLinkService">
 /// The share Link Service.
 /// </param>
 public MainViewModel(IApplicationManifestService applicationManifestService)
 {
     _applicationManifest = applicationManifestService.GetApplicationManifest();
     _appUrl = string.Concat("http://windowsphone.com/s?appid=", _applicationManifest.App.ProductId);
 }