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


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)

public abstract License GetLicense(
	LicenseContext context,
	Type type,
	object instance,
	bool allowExceptions


Type: System.ComponentModel.LicenseContext

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

Type: System.Type

A Type that represents the component requesting the license.

Type: System.Object

An object that is requesting the license.

Type: System.Boolean

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

Return Value

Type: System.ComponentModel.License

A valid License.

Notes to Inheritors:

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

.NET Framework
Available since 1.1
Return to top