Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Confused by some LicenseManager methods

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support
View previous topic :: View next topic  
Author Message
Lord
Guest





PostPosted: Thu May 18, 2006 10:23 am    Post subject: Confused by some LicenseManager methods Reply with quote

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

PostPosted: Thu May 18, 2006 12:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Lord
Guest





PostPosted: Thu May 18, 2006 1:33 pm    Post subject: Reply with quote

THANK YOU!! Very Happy
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group