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.

Namespace: System.ComponentModel
Assembly: System (in system.dll)

Syntax

Visual Basic (Declaration)
Public MustOverride Function GetLicense ( _
    context As LicenseContext, _
    type As Type, _
    instance As Object, _
    allowExceptions As Boolean _
) As License
Visual Basic (Usage)
Dim instance As LicenseProvider
Dim context As LicenseContext
Dim type As Type
Dim instance As Object
Dim allowExceptions As Boolean
Dim returnValue As License

returnValue = instance.GetLicense(context, type, instance, allowExceptions)
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
) abstract
J#
public abstract License GetLicense (
    LicenseContext context, 
    Type type, 
    Object instance, 
    boolean allowExceptions
)
JScript
public abstract function GetLicense (
    context : LicenseContext, 
    type : Type, 
    instance : Object, 
    allowExceptions : boolean
) : License
XAML
Not applicable.

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: When you inherit from LicenseProvider, you must override GetLicense to implement a validation method for the license key.

Platforms

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0
See Also

Tags :


Page view tracker