GetLicense Method
Collapse the table of content
Expand the table of content

LicenseProvider.GetLicense Method

When overridden in a derived class, gets a license for an instance or type of component, when given a context and whether the denial of a license throws an exception.

[Visual Basic]
Public MustOverride Function GetLicense( _
   ByVal context As LicenseContext, _
   ByVal type As Type, _
   ByVal instance As Object, _
   ByVal allowExceptions As Boolean _
) As License
public abstract License GetLicense(
 LicenseContext context,
 Type type,
 object instance,
 bool allowExceptions
public: virtual License* GetLicense(
 LicenseContext* context,
 Type* type,
 Object* instance,
 bool allowExceptions
) = 0;
public abstract function GetLicense(
   context : LicenseContext,
 type : Type,
 instance : Object,
 allowExceptions : Boolean
) : License;


A LicenseContext that specifies where you can use the licensed object.
A Type that represents the component requesting the license.
An object that is requesting the license.
true if a LicenseException should be thrown when the component cannot be granted a license; otherwise, false.

Return Value

A valid License.


Notes to Inheritors:  The object asking for a License must Dispose the License when the object is disposed of or finalized.

Notes to Inheritors:  When you inherit from LicenseProvider, you must override GetLicense to implement a validation method for the license key.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

LicenseProvider Class | LicenseProvider Members | System.ComponentModel Namespace | Dispose | License | LicenseContext | LicenseException | LicenseManager | LicenseProvider | LicenseProviderAttribute | LicFileLicenseProvider | LicenseUsageMode

© 2016 Microsoft