LicenseProvider.GetLicense(LicenseContext, Type, Object, Boolean) Метод

Определение

При переопределении в производном классе получает лицензию для экземпляра или типа компонента, если задан контекст и возникает ли отказ в лицензии.

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

Параметры

context
LicenseContext

Значение, LicenseContext указывающее, где можно использовать лицензированный объект.

type
Type

Объект, Type представляющий компонент, запрашивающий лицензию.

instance
Object

Объект, запрашивающий лицензию.

allowExceptions
Boolean

true Значение LicenseException , если компонент не может быть предоставлена лицензия; в противном случае false.

Возвращаемое значение

Допустимый Licenseобъект .

Примечания для тех, кто реализует этот метод

При наследовании LicenseProviderнеобходимо переопределить GetLicense(LicenseContext, Type, Object, Boolean) для реализации метода проверки ключа лицензии.

Применяется к

См. также раздел