LicenseProvider.GetLicense(LicenseContext, Type, Object, Boolean) Method

Definition

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.

C#
public abstract System.ComponentModel.License? GetLicense(System.ComponentModel.LicenseContext context, Type type, object? instance, bool allowExceptions);
C#
public abstract System.ComponentModel.License GetLicense(System.ComponentModel.LicenseContext context, Type type, object instance, bool allowExceptions);

Parameters

context
LicenseContext

A LicenseContext that specifies where you can use the licensed object.

type
Type

A Type that represents the component requesting the license.

instance
Object

An object that is requesting the license.

allowExceptions
Boolean

true if a LicenseException should be thrown when the component cannot be granted a license; otherwise, false.

Returns

A valid License.

Notes to Implementers

When you inherit from LicenseProvider, you must override GetLicense(LicenseContext, Type, Object, Boolean) to implement a validation method for the license key.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also