View previous topic :: View next topic |
Author |
Message |
greek
Joined: 07 Feb 2007 Posts: 7
|
Posted: Thu Feb 08, 2007 3:45 pm Post subject: Using inherited controls |
|
|
Hi all
suppose you have this licensed control:
Code: | <LicenseProvider(GetType(EncryptedLicenseProvider))> _
Public Class MyControl
Inherits System.Windows.Forms.Control
End Class
|
and another licensed control that inherits from the control above:
Code: | <LicenseProvider(GetType(EncryptedLicenseProvider))> _
Public Class MyInheritedControl
Inherits MyControl
End Class
|
This means that license is checked twice?
I have another question: using ILS3, and assuming I'm developing a collection of controls, what is the fastest and easiest way to get the current License object from any part of the code?
Thank you. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Feb 08, 2007 10:26 pm Post subject: |
|
|
The LicenseProvider attribute doesn't actually cause the license to be checked (the code in the control constructor typically does this). The attribute associates the license provider with the control type. This means that when you then call the LicenseManager class to get the license for a given type it will use that LicenseProvider. Visual Studio will also realize that it is a licensed control and add an entry in the Licenses.licx file when you use the designer to add the control.
If you put the license check in both controls constructors then it would indeed get checked twice. If you have different licenses for the base and derived control then this might be what you want (ie the customer needs both licenses to use the derived control). If you are licensing a suite of controls and want to use a single license for them all then check out our FAQ on the subject:
http://www.infralution.com/phpBB2/viewtopic.php?t=207 _________________ Infralution Support |
|
Back to top |
|
|
|