Exemple #1
0
        private void SetupMockIAP()
        {
            MockIAP.Init();

            MockIAP.RunInMockMode(true);
            MockIAP.SetListingInformation(1, "en-us", "2D Platformer", "$0.00", "2D Platformer");

            var mockupLicenseInfo = App.GetResourceStream(new Uri("Assets\\Xmls\\MockupLicenseInfo.xml", UriKind.Relative));

            System.Xml.Linq.XDocument doc = System.Xml.Linq.XDocument.Load(mockupLicenseInfo.Stream);
            string xml = doc.ToString();

            MockIAP.PopulateIAPItemsFromXml(xml);

            GetListingInfo();

            // Add some more items manually.
            //ProductListing p = new ProductListing
            //{
            //    Name = "img.2",
            //    ImageUri = new Uri("/Res/Image/2.jpg", UriKind.Relative),
            //    ProductId = "img.2",
            //    ProductType = Windows.ApplicationModel.Store.ProductType.Durable,
            //    Keywords = new string[] { "image" },
            //    Description = "An image",
            //    FormattedPrice = "1.0",
            //    Tag = string.Empty
            //};
            //MockIAP.AddProductListing("img.2", p);
        }
Exemple #2
0
        public static void LoadTest(uint ageRating, string currentMarket, string description, string formattedPrice, string name, string xml)
        {
#if DEBUG
            MockIAP.Init();

            MockIAP.RunInMockMode(true);
            MockIAP.SetListingInformation(ageRating, currentMarket, description, formattedPrice, name);

            MockIAP.PopulateIAPItemsFromXml(xml);
#endif
        }
Exemple #3
0
        /// <summary>   Setup the Windows Store test mode by loading the IAPMock.xml file at the root path. </summary>
        private void SetupMockIAP()
        {
            MockIAP.Init();

            MockIAP.RunInMockMode(true);
            MockIAP.SetListingInformation(1, "en-us", "A description", "0", "TestApp");
            var xDocument = XDocument.Load("IAPMock.xml");

            SoomlaUtils.LogDebug(TAG, "WStorePlugin Mock XML " + xDocument.ToString());

            MockIAP.PopulateIAPItemsFromXml(xDocument.ToString());
        }
Exemple #4
0
        private void SetupInAppMock()
        {
            MockIAP.Init();

            MockIAP.RunInMockMode(true);

            MockIAP.SetListingInformation(1, "de-DE", "Verändere Bilder mit Filter", "1,99 €", "Image Filters");
            var streamInfo = GetResourceStream(new Uri("Assets/InAppMockProducts.xml", UriKind.Relative));

            using (var reader = new StreamReader(streamInfo.Stream))
            {
                string xml = reader.ReadToEnd();
                MockIAP.PopulateIAPItemsFromXml(xml);
            }
        }
Exemple #5
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard XAML initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Language display initialization
            InitializeLanguage();

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                //Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Prevent the screen from turning off while under the debugger by disabling
                // the application's idle detection.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
#if DEBUG
            MockIAP.Init();

            MockIAP.RunInMockMode(true);
            MockIAP.SetListingInformation(1, "en-us", "A description", "1", "TestApp");
            StreamResourceInfo xml        = Application.GetResourceStream(new Uri("MockProducts.xml", UriKind.Relative));
            XElement           appDataXml = XElement.Load(xml.Stream);
            MockIAP.PopulateIAPItemsFromXml(appDataXml.ToString());

            MockIAP.ClearCache();
#endif
        }
Exemple #6
0
        private void Browser_Loaded(object sender, RoutedEventArgs e)
        {
            // Load IAP Listing Information

#if DEBUG
            //Use Mock API instead of real store
            MockIAP.Init();
            MockIAP.RunInMockMode(true);
            MockIAP.SetListingInformation(1, "en-us", "Your App Description", "$1.99", "Your App Name");

            // initialize to empty product list in case debug IAP functionality is not needed
            string xml = @"<ProductListings></ProductListings>";

            var sri = App.GetResourceStream(new Uri("WindowsStoreProxy.xml", UriKind.Relative));
            if (sri != null)
            {
                System.Xml.Linq.XDocument doc = System.Xml.Linq.XDocument.Load(sri.Stream);
                xml = doc.ToString();
            }

            MockIAP.PopulateIAPItemsFromXml(xml);
#endif
        }