I think I'll give a quick example, incase I'm missing something really
obvious here,
My licensing class library contains several classes for licensing
applications and controls, the main ones which the developer interacts with
are
myLicenseProvider
^ A license provider that does the main business
and
myLicenseAttribute
^ A custom attribute which is used to pass addition information to the
license provider upon initialization
Protecting anything becomes really easy with this, you basically do exactly
as you would with a LicFileLicenseProvider with the exception that you need
to include another attribute for each licensed class to set some extra
properties which are essential to getting a valid license.
For example,
<LicenseProvider(GetType(myLicenseProvider)), _
npLicenseAttribute(..parameters are passed here but are irrelivant...)> _
Public Class Class1
Private cLicLicence As npLicense
Public Sub New()
cLicLicence = CType(LicenseManager.Validate(GetType(Class1), Me),
npLicense)
End Sub
Protected Overrides Sub Finalize()
MyBase.Finalize()
If Not (cLicLicence Is Nothing) Then
cLicLicence.Dispose()
cLicLicence = Nothing
End If
End Sub
End Class
This is great and suits me down to the ground, *but* I want to use this same
method of licensing to protect "myLicenseProvider". Now in theory this is
impossible as the license provider would need to create a new license
provider to validate its license and the provider that it creates would have
to do likewise, hence forth an endless loop has occured.
The same goes for *any* other object used in myLicenseProvider that I have
created, I cannot license them as they will recurse themselves into a big
hole of muchness. The only thing that I can think of is to put code into
the class constructor of myLicenseProvider to call its internal routines and
validate its own license before it does anything else, but surely this is a
bit of a bodge isn't it? How would this normally be tackled, I'm trying not
to make things slack as I want to rely on this class library for all my
future projects.
Nick.
"Nak" <a@a.com> wrote in message
news:uu**************@TK2MSFTNGP09.phx.gbl...
What do you mean? My class needs to be licensed or any tom dick and harry
could use the class library to protect their applications. But I dont
seem to be able to protect anything within it! :-\
Nick.
"One Handed Man ( OHM - Terry Burns )" <news.microsoft.com> wrote in
message news:es**************@TK2MSFTNGP11.phx.gbl... Ahem, well, cant you just instantiate a new one ?
--
OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me
Time flies when you don't know what you're doing
"Nak" <a@a.com> wrote in message
news:er**************@TK2MSFTNGP15.phx.gbl... Hi there,
I was wondering what the normal procedure for making a license
provider require licensing was?
I have just created a licensing class library and I want to make it
require a license to be used, but I cannot protect the license provider
with itself as you just get a massive recursion issue taking place. Can I
protect my own "protector"? :-\
Nick.