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
[C#]
public abstract License GetLicense(
 LicenseContext context,
 Type type,
 object instance,
 bool allowExceptions
);
[C++]
public: virtual License* GetLicense(
 LicenseContext* context,
 Type* type,
 Object* instance,
 bool allowExceptions
) = 0;
[JScript]
public abstract function GetLicense(
   context : LicenseContext,
 type : Type,
 instance : Object,
 allowExceptions : Boolean
) : License;

Parameters

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

Return Value

A valid License.

Remarks

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.

Requirements

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

Show:
© 2016 Microsoft