View previous topic :: View next topic |
Author |
Message |
Lord Guest
|
Posted: Thu May 18, 2006 10:23 am Post subject: Confused by some LicenseManager methods |
|
|
Hello
I'm just starting i understanding licensing thecnology.
I got confused by three similar methods of Framework LicenseManager class.
MSDN reports:
IsLicensed = Returns whether the given type has a valid license.
IsValid = Determines whether a valid license can be granted.
Validate = Determines whether a license can be granted.
Can some Infralution expert explain the difference between these similar methods and when the use of each one is reccomended against the others?
Many thanks |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu May 18, 2006 12:19 pm Post subject: |
|
|
We would only recommend using the LicenseManager methods if you are licensing components or controls. If you are licensing an application it is generally much easy to use one of the EncryptedLicenseProvider.GetLicense methods directly (see our Licensed Application sample project for an example). If you are licensing components or controls then the main differences between the methods is:
- IsLicensed - simple method which returns true/false. Use if you don't need to get information out of the license (ie you just need to know whether a license is installed)
- IsValid - still returns true/false (rather than using exceptions) but also returns the license (if any) to allow you to get information out of the license. Use this if you are including information in the ProductInfo of the license which you need to extract when checking the license.
- Validate - raises an exception if there is no license installed. This just provides an alternative way for you to handle the case where there is no license. Its mainly just a matter of style as to whether prefer to handle error conditions via exceptions or return values.
_________________ Infralution Support |
|
Back to top |
|
|
Lord Guest
|
Posted: Thu May 18, 2006 1:33 pm Post subject: |
|
|
THANK YOU!! |
|
Back to top |
|
|
|