Ejemplo n.º 1
0
        async Task <bool> PlatformAccessFeature(IActiveAddOn addOn, Action <bool> feature, bool conditionWhenFree)
        {
            if (addOn == null)
            {
                throw new ArgumentNullException(nameof(addOn));
            }

            var isActive = await PlatformIsActive(addOn);

            if (isActive || conditionWhenFree)
            {
                feature.Invoke(isActive);
                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
        async Task <bool> PlatformIsActive(IActiveAddOn addOn)
        {
            if (!(addOn is AddOn storeAddOn))
            {
                throw new ArgumentNullException(nameof(addOn));
            }

            if (context == null)
            {
                context = StoreContext.GetDefault();
            }

            // Specify the kinds of add-ons to retrieve.
            var license = await context.GetAppLicenseAsync();

            return(license.AddOnLicenses.TryGetValue(storeAddOn.Id, out var l) ? l.IsActive : false);
        }
Ejemplo n.º 3
0
 Task <bool> PlatformIsActive(IActiveAddOn addOn)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
 Task <bool> PlatformAccessFeature(IActiveAddOn addOn, Action <bool> feature, bool conditionWhenFree)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 public async Task <bool> AccessFeature(IActiveAddOn addOn, Action <bool> feature, bool conditionWhenFree)
 {
     return(await PlatformAccessFeature(addOn, feature, conditionWhenFree));
 }
Ejemplo n.º 6
0
 public async Task <bool> IsActive(IActiveAddOn addOn)
 {
     return(await PlatformIsActive(addOn));
 }