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

Definicja

W przypadku zastąpienia w klasie pochodnej otrzymuje licencję dla wystąpienia lub typu składnika, gdy dany kontekst i czy odmowa licencji zgłasza wyjątek.

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

Parametry

context
LicenseContext

Element LicenseContext określający, gdzie można użyć licencjonowanego obiektu.

type
Type

Element Type reprezentujący składnik żądający licencji.

instance
Object

Obiekt, który żąda licencji.

allowExceptions
Boolean

true jeśli element LicenseException powinien zostać zgłoszony, gdy składnik nie może otrzymać licencji; w przeciwnym razie false.

Zwraca

License

Prawidłowa Licensewartość .

Uwagi dotyczące implementowania

Po dziedziczeniu z LicenseProviderprogramu należy zastąpić GetLicense(LicenseContext, Type, Object, Boolean) metodę walidacji klucza licencji.

Dotyczy

Zobacz też