LicenseContext 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指定何时可以使用许可对象,并提供获取支持其域中运行的许可证所需的其他服务的方法。
public ref class LicenseContext : IServiceProvider
public class LicenseContext : IServiceProvider
type LicenseContext = class
interface IServiceProvider
Public Class LicenseContext
Implements IServiceProvider
- 继承
-
LicenseContext
- 派生
- 实现
注解
此类提供默认值 LicenseContext。 它仅实现运行时支持,不支持保存的许可证密钥。
继承者说明
如果要实现设计时许可证支持,必须继承自此类,并重写以下成员: UsageMode、 GetSavedLicenseKey(Type, Assembly)、 GetService(Type)和 SetSavedLicenseKey(Type, String)。 如果要实现保存的许可证密钥,请重写 GetSavedLicenseKey(Type, Assembly) 和 SetSavedLicenseKey(Type, String) 方法。
构造函数
| 名称 | 说明 |
|---|---|
| LicenseContext() |
初始化 LicenseContext 类的新实例。 |
属性
| 名称 | 说明 |
|---|---|
| UsageMode |
在派生类中重写时,获取一个值,该值指定何时可以使用许可证。 |
方法
| 名称 | 说明 |
|---|---|
| Equals(Object) |
确定指定对象是否等于当前对象。 (继承自 Object) |
| GetHashCode() |
用作默认哈希函数。 (继承自 Object) |
| GetSavedLicenseKey(Type, Assembly) |
在派生类中重写时,从指定的资源程序集中返回指定类型的已保存许可证密钥。 |
| GetService(Type) |
获取请求的服务(如果可用)。 |
| GetType() |
获取当前实例的 Type。 (继承自 Object) |
| MemberwiseClone() |
创建当前 Object的浅表副本。 (继承自 Object) |
| SetSavedLicenseKey(Type, String) |
在派生类中重写时,为指定类型设置许可证密钥。 |
| ToString() |
返回一个表示当前对象的字符串。 (继承自 Object) |