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) , чтобы реализовать метод проверки для лицензионного ключа.

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

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