public void SetUserStoreContext(object sender, SelectionChangedEventArgs e)
        {
            ComboBox control = sender as ComboBox;

            if (control == null)
            {
                return;
            }

            UserDataWrapper user = control.SelectedItem as UserDataWrapper;

            storeContext = null;
            storeContext = StoreContext.GetForUser(user.Self);
        }
Пример #2
0
        public async Task <bool> GetAddOnLicenseInfo()
        {
            bool IsActive = false;

            var users = await User.FindAllAsync();

            StoreContext context = StoreContext.GetForUser(users[0]);

            StoreAppLicense appLicense = await context.GetAppLicenseAsync();

            System.Diagnostics.Debug.WriteLine(appLicense.AddOnLicenses.Count);

            foreach (KeyValuePair <string, StoreLicense> item in appLicense.AddOnLicenses)
            {
                StoreLicense addOnLicense = item.Value;

                if (addOnLicense.SkuStoreId.ToLower().Contains("9pc587j41rs1"))
                {
                    PremiumFeaturesActivatedType = "Month";
                }
                else if (addOnLicense.SkuStoreId.ToLower().Contains("9pf5zlm4lprg"))
                {
                    PremiumFeaturesActivatedType = "Year";
                }
                else
                {
                    return(false);
                }

                PremiumFeaturesActivatedRemain = (addOnLicense.ExpirationDate - DateTime.Now).Days.ToString();

                IsActive = addOnLicense.IsActive;
            }

            return(IsActive);
        }
 public InAppPurchaseManager(User user)
 {
     Context = StoreContext.GetForUser(user);
 }