Reading the source code indicates the Licensprovider first looks in an internal cache, secondly in the isolated storage.
At the same time it tries to fetch the license from the filesystem as follows (depending if it's a webapp or a windows app:
Obtains a license from a preset set of paths. The paths are defined as:
- The Application Bin directory
- Application start path
In code:
HttpContext.Current.Server.MapPath( "~" + Path.DirectorySeparatorChar );
HttpContext.Current.Server.MapPath( "." + Path.DirectorySeparatorChar );
HttpContext.Current.Server.MapPath( "~" + Path.DirectorySeparatorChar ) + "bin";
or for a windows app:
System.Windows.Forms.Application.StartupPath + Path.DirectorySeparatorChar
System.Windows.Forms.Application.StartupPath + Path.DirectorySeparatorChar + "bin" + Path.DirectorySeparatorChar;
if the license in the filesystem is newer then the license in the isolated storage, a copy of your alternative license is stored.
And concerning the usage in code. The example shows that you need to use the library as follows:
use an Attribute at the Class declaration to indicate that you will use the OpenLicenseProvider as the license provider:
using System.ComponentModel;
...
enter code here
[LicenseProvider( typeof( OpenLicense.OpenLicenseProvider ) )]
public class MyClass
{
...
Then in code use the LicenseManager to validate the license with OpenLicenseProvider:
private License license = null;
LicenseManager.IsValid( typeof( MyClass ), this, out license );