LicenseManager.CurrentContext 属性

获取或设置当前的 LicenseContext,它指定您何时可以使用已授权的对象。

**命名空间:**System.ComponentModel
**程序集:**System(在 system.dll 中)

语法

声明
Public Shared Property CurrentContext As LicenseContext
用法
Dim value As LicenseContext

value = LicenseManager.CurrentContext

LicenseManager.CurrentContext = value
public static LicenseContext CurrentContext { get; set; }
public:
static property LicenseContext^ CurrentContext {
    LicenseContext^ get ();
    void set (LicenseContext^ value);
}
/** @property */
public static LicenseContext get_CurrentContext ()

/** @property */
public static void set_CurrentContext (LicenseContext value)
public static function get CurrentContext () : LicenseContext

public static function set CurrentContext (value : LicenseContext)

属性值

一个 LicenseContext,指定何时可以使用已授权的对象。

异常

异常类型 条件

InvalidOperationException

CurrentContext 属性当前被锁定,因而无法更改它。

备注

当用户请求有效的 License 时,用户必须给出上下文,在该上下文中 LicenseLicenseProvider.GetLicense 方法有效。该属性返回的 LicenseContext 应该被传递给所有 LicenseProvider 类。

平台

Windows 98、Windows 2000 SP4、Windows Millennium Edition、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

LicenseManager 类
LicenseManager 成员
System.ComponentModel 命名空间
License 类
LicenseContext 类
LicenseException 类
LicenseProvider
LicenseProviderAttribute
LicFileLicenseProvider
LicenseUsageMode