예제 #1
0
        public static async Task <ListingInformation> LoadListingInformationByProductIdsAsync(string[] ProductIds)
        {
            MockIAP.CheckIfInitialized();

            ListingInformation listingInformation;

            if (!MockIAP.MockMode)
            {
                Windows.ApplicationModel.Store.ListingInformation li = await Windows.ApplicationModel.Store.CurrentApp.LoadListingInformationByProductIdsAsync(ProductIds);

                listingInformation = new ListingInformation(li);
            }
            else
            {
                listingInformation = MockIAP.GetListingInformation();
                listingInformation.ProductListings = new Dictionary <string, ProductListing>();

                IEnumerable <string> result = from key in MockIAP.allProducts.Keys
                                              join pId in ProductIds on MockIAP.allProducts[key].ProductId equals pId
                                              select key;

                result.ToList().ForEach(k => listingInformation.ProductListings.Add(k, MockIAP.allProducts[k]));
            }

            return(listingInformation);
        }
예제 #2
0
        public static async Task <ListingInformation> LoadListingInformationAsync()
        {
            MockIAP.CheckIfInitialized();

            ListingInformation listingInformation;

            if (!MockIAP.MockMode)
            {
                Windows.ApplicationModel.Store.ListingInformation li = await Windows.ApplicationModel.Store.CurrentApp.LoadListingInformationAsync();

                listingInformation = new ListingInformation(li);

                LicenseInformation = new LicenseInformation(Windows.ApplicationModel.Store.CurrentApp.LicenseInformation);
            }
            else
            {
                listingInformation = MockIAP.GetListingInformation();
                listingInformation.ProductListings = MockIAP.allProducts;
            }

            return(listingInformation);
        }