Udostępnij przez


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

Definicja

Po zastąpieniu w klasie pochodnej pobiera 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ć obiektu licencjonowanego.

type
Type

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

instance
Object

Obiekt, który żąda licencji.

allowExceptions
Boolean

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

Zwraca

Prawidłowa Licensewartość .

Uwagi dotyczące implementowania

Gdy dziedziczysz z LicenseProviderklasy , należy przesłonić GetLicense(LicenseContext, Type, Object, Boolean) , aby zaimplementować metodę weryfikacji klucza licencji.

Dotyczy

Zobacz też