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

如果当组件无法授予许可证时应引发 a,则为 />;否则为 >。

返回

有效的 License

实施者说明

LicenseProvider继承时,必须重写 GetLicense(LicenseContext, Type, Object, Boolean) 才能实现许可证密钥的验证方法。

适用于

另请参阅