LicenseProvider.GetLicense(LicenseContext, Type, Object, Boolean) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在派生类中重写时,当给定上下文以及拒绝许可证是否引发异常时,获取实例或组件类型的许可证。
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 ,指定可以使用许可对象的位置。
- instance
- Object
请求许可证的对象。
- allowExceptions
- Boolean
返回
有效的 License。
实施者说明
从 LicenseProvider继承时,必须重写 GetLicense(LicenseContext, Type, Object, Boolean) 才能实现许可证密钥的验证方法。