Abstracting the LicenseInformation Class
The downloadable sample code includes a custom ILicenseService
interface, which contains a single property called Trial
, indicating the trial state of the app. There are two implementations of this interface: one for testing and one for production.
The production implementation named LicensingService
wraps a LicenseInformation
instance, as shown in the following excerpt:
public class LicensingService : ILicensingService{ public bool Trial { get { LicenseInformation licenseInformation = new LicenseInformation(); return licenseInformation.IsTrial(); } }}
During development and testing, the ...
Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.