LicenseManager.IsValid 方法
本文内容
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
确定是否可以授予有效的许可证。
IsValid(Type) |
确定是否可以为指定类型授予有效的许可证。 |
IsValid(Type, Object, License) |
确定是否可以为该类型的指定实例授予有效的许可证。 该方法创建有效的 License。 |
- Source:
- LicenseManager.cs
- Source:
- LicenseManager.cs
- Source:
- LicenseManager.cs
确定是否可以为指定类型授予有效的许可证。
public:
static bool IsValid(Type ^ type);
public static bool IsValid (Type type);
static member IsValid : Type -> bool
Public Shared Function IsValid (type As Type) As Boolean
参数
返回
如果可以授予有效许可证,则为 true
;否则为 false
。
注解
当 IsValid 类型未获得许可或已获得许可且许可证有效时,方法将返回 true
。
当无法授予有效的 License时,此方法不会引发 LicenseException 。 方法 Validate 引发异常。
另请参阅
- License
- LicenseContext
- LicenseException
- LicenseProvider
- LicenseProviderAttribute
- LicFileLicenseProvider
- LicenseUsageMode
适用于
.NET 9 和其他版本
产品 | 版本 |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
- Source:
- LicenseManager.cs
- Source:
- LicenseManager.cs
- Source:
- LicenseManager.cs
确定是否可以为该类型的指定实例授予有效的许可证。 该方法创建有效的 License。
public:
static bool IsValid(Type ^ type, System::Object ^ instance, [Runtime::InteropServices::Out] System::ComponentModel::License ^ % license);
public static bool IsValid (Type type, object instance, out System.ComponentModel.License license);
public static bool IsValid (Type type, object? instance, out System.ComponentModel.License? license);
static member IsValid : Type * obj * License -> bool
Public Shared Function IsValid (type As Type, instance As Object, ByRef license As License) As Boolean
参数
- instance
- Object
指定类型的对象或从指定类型派生的类型的对象。
返回
如果可以颁发有效的 License,则为 true
;否则为 false
。
注解
当IsValidtype
参数未获得许可或已获得许可且参数有效时,license
方法将返回 true
。
当无法授予有效的 License时,此方法不会引发 LicenseException 。 方法 Validate 引发异常。
license
如果 参数不是null
在此调用之后,则请求 的对象License必须在释放或最终确定对象时通过调用 Dispose 方法来释放许可证。
另请参阅
- License
- LicenseContext
- LicenseException
- LicenseProvider
- LicenseProviderAttribute
- LicFileLicenseProvider
- LicenseUsageMode
适用于
.NET 9 和其他版本
产品 | 版本 |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |