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); }
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); }
Task <bool> PlatformIsActive(IActiveAddOn addOn) { throw new NotImplementedException(); }
Task <bool> PlatformAccessFeature(IActiveAddOn addOn, Action <bool> feature, bool conditionWhenFree) { throw new NotImplementedException(); }
public async Task <bool> AccessFeature(IActiveAddOn addOn, Action <bool> feature, bool conditionWhenFree) { return(await PlatformAccessFeature(addOn, feature, conditionWhenFree)); }
public async Task <bool> IsActive(IActiveAddOn addOn) { return(await PlatformIsActive(addOn)); }