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 

A small suggestion, please

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






PostPosted: Mon Jul 17, 2006 7:35 am    Post subject: A small suggestion, please Reply with quote

Hello
suppose I have these two controls:

Code:

  Public Class EnhancedTextBox
    Inherits TextBox
    Public Sub New()
    'Licensing
    Licensing.EncryptedLicenseProvider.CheckLicense(GetType(EnhancedTextBox), Me)
    'Other initialization code goes here
    End Sub
  End Class

  Public Class EnhancedTextBoxSmart
    Inherits EnhancedTextBox
    Public Sub New()
    'Licensing
    Licensing.EncryptedLicenseProvider.CheckLicense(GetType(EnhancedTextBoxSmart), Me)
    End Sub
  End Class


Currently, the license check for EnhancedTextBoxSmart is performed twice. The first for EnhancedTextBox, and the second for EnhancedTextBoxSmart.
What is the best way for having the license checked only once (for EnhancedTextBoxSmart and NOT for its parent EnhancedTextBox)?

Thank you.
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jul 17, 2006 9:17 am    Post subject: Reply with quote

Do you license the two controls separately? If not then you don't need to bother checking the license in the derived control - since the base class will check it.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Mon Jul 17, 2006 1:09 pm    Post subject: Reply with quote

Infralution wrote:
Do you license the two controls separately?


Yes.

The very simple situation I described here is very common on our packages. i.e. we have some controls sold as "base" packages, and other controls (that inherits from "base" controls) sold separately.

At the moment, for EnhancedTextBoxSmart, the NAG window requiring license key is asked twice: one for the base class and one for the derived Sad
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jul 17, 2006 10:32 pm    Post subject: Reply with quote

In that case I suggest that in the constructor of your controls you check the assembly that is calling it and only do the licensing check if it isn't being called from the same assembly eg

Code:
if (Assembly.GetCallingAssembly() != Assembly.GetExecutingAssembly())
{
    // check license
}

_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
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