February 01, 2006

.Net Licensing

Step by Step with .Net Licensing (for Control or Form)
If you wanna build a control (that we called NewControl) and use the .Net Licensing for that, go ahead:

1-The licensed control requests a license from the LicenseManager in its constructor.
[PS1: LicenseManager is a sealed (not inheritable) class for provides usefull properties and methods for connecting to a LicenseProvider]
license = LicenseManager.Validate(typeof(NewControl), this);
2- The our LicenseManager rerequests a licence from the LicenseProvider with GetLicense().
[PS2:We can define our LicenseProvider at the top of our class's control (that we called NewLicenseProvider)]
public class NewControl : System.Windows.Forms.Control{ ...}
3- We must declare a NewLicenseProvider of System.ComponentModel.LicenseProvider and override the GetLicense like :public
override License GetLicense(LicenseContext context, Type type, object instance, bool allowExceptions)

We want to talk more about this ...
If you have a problem on this field .. come on ... post a comment

No comments: