Uredi

Deli z drugimi prek


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.

public:
 abstract System::ComponentModel::License ^ GetLicense(System::ComponentModel::LicenseContext ^ context, Type ^ type, System::Object ^ instance, bool allowExceptions);
public abstract System.ComponentModel.License GetLicense (System.ComponentModel.LicenseContext context, Type type, object instance, bool allowExceptions);
public abstract System.ComponentModel.License? GetLicense (System.ComponentModel.LicenseContext context, Type type, object? instance, bool allowExceptions);
abstract member GetLicense : System.ComponentModel.LicenseContext * Type * obj * bool -> System.ComponentModel.License
Public MustOverride Function GetLicense (context As LicenseContext, type As Type, instance As Object, allowExceptions As Boolean) As License

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

See also