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 

License separate classes in an assembly.

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



Joined: 27 Jul 2011
Posts: 16

PostPosted: Tue Jul 10, 2012 1:58 pm    Post subject: License separate classes in an assembly. Reply with quote

I want to license separate classes in an assembly. Is there a way to do this?

Is it possible to get the EncryptedLicense at runtime? I only see a way to check LicenseManager.IsLicensed(Type), or get the License, but not the EncryptedLicense, from which I could get additional product info.

At the moment I use separate LICENSE_PARAMETERS for each class, but this doesn't seem very convenient for the customer (or us). I'd prefer 1 LICENSE_PARAMETERS, and then put something in product info for each separately licensed class.

- Wout
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Jul 10, 2012 11:41 pm    Post subject: Reply with quote

Yes you can get the encrypted license by calling the LicenseManager.IsValid method instead of the IsLicensed method. You then need to cast the license object returned in the out parameter to an EncryptedLicense is follows:

Code:
License license;
if (LicenseManager.IsValid(typeof(MyControl), this, out license))
{
    EncryptedLicense encryptedLicense = license as EncryptedLicense;
    string licensedProduct = encryptedLicense.ProductInfo;
}

You can then use a single LICENSE_PARAMETERS and include a string that identifies the licensed components in the ProductInfo.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
wout



Joined: 27 Jul 2011
Posts: 16

PostPosted: Wed Jul 11, 2012 8:25 am    Post subject: Reply with quote

Ah, I didn't know it could be cast, thanks for the hint, I will try this!

- Wout
Back to top
View user's profile Send private message
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