LicenseContext 类

定义

指定何时可使用授权的对象,并且提供一种方法,用以获取为支持在其域内运行的许可证所需要的附加服务。Specifies when you can use a licensed object and provides a way of obtaining additional services needed to support licenses running within its domain.

public ref class LicenseContext : IServiceProvider
public class LicenseContext : IServiceProvider
type LicenseContext = class
    interface IServiceProvider
Public Class LicenseContext
Implements IServiceProvider
继承
LicenseContext
派生
实现

注解

此类提供默认值LicenseContextThis class provides the default LicenseContext. 它仅实现运行时支持, 不支持保存的许可证密钥。It implements only run-time support and does not support saved license keys.

继承者说明

如果要实现设计时许可证支持, 则必须从此类继承并重写以下成员UsageMode:、 GetSavedLicenseKey(Type, Assembly)GetService(Type)SetSavedLicenseKey(Type, String)If you want to implement design-time license support, you must inherit from this class, and override the following members: UsageMode, GetSavedLicenseKey(Type, Assembly), GetService(Type), and SetSavedLicenseKey(Type, String). 如果要实现保存的GetSavedLicenseKey(Type, Assembly)许可证密钥, 请重写和SetSavedLicenseKey(Type, String)方法。If you want to implement saved license keys, override the GetSavedLicenseKey(Type, Assembly) and SetSavedLicenseKey(Type, String) methods.

有关授权的详细信息, 请参阅如何:许可证组件和控件For more information about licensing, see How to: License Components and Controls.

构造函数

LicenseContext()

初始化 LicenseContext 类的新实例。Initializes a new instance of the LicenseContext class.

属性

UsageMode

当在派生类中被重写时,获取一个指定何时可使用许可证的值。When overridden in a derived class, gets a value that specifies when you can use a license.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetSavedLicenseKey(Type, Assembly)

当在派生类中被重写时,从指定的资源程序集中为指定类型返回已保存的许可证密钥。When overridden in a derived class, returns a saved license key for the specified type, from the specified resource assembly.

GetService(Type)

获取请求的服务(如果该服务可用的话)。Gets the requested service, if it is available.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
SetSavedLicenseKey(Type, String)

当在派生类中被重写时,为指定的类型设置许可证密钥。When overridden in a derived class, sets a license key for the specified type.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅