LicenseManager.IsValid 方法

定義

判斷是否授與有效授權。

多載

IsValid(Type)

判斷是否授與指定型別的有效授權。

IsValid(Type, Object, License)

判斷是否授與型別之指定執行個體的有效授權。 這個方法會建立有效的 License

IsValid(Type)

來源:
LicenseManager.cs
來源:
LicenseManager.cs
來源:
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

參數

type
Type

Type,表示要求 License 的物件型別。

傳回

如果授與有效授權,則為 true,否則為 false

備註

當類型不是授權或已授權且授權有效時,方法 IsValid 會傳回 true

這個方法不會在無法授與有效的 License時擲回 LicenseException 。 方法 Validate 會擲回例外狀況。

另請參閱

適用於

IsValid(Type, Object, License)

來源:
LicenseManager.cs
來源:
LicenseManager.cs
來源:
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

參數

type
Type

Type,表示要求授權的物件型別。

instance
Object

指定型別的物件或衍生自指定型別的型別。

license
License

License 是有效的授權;如果無法授與有效授權,則為 null

傳回

如果可以授與有效的 License,則為 true,否則為 false

備註

type參數未獲得授權,或取得授權且license參數有效時,方法IsValid會傳回 true

這個方法不會在無法授與有效的 License時擲回 LicenseException 。 方法 Validate 會擲回例外狀況。

license如果參數不在null呼叫之後,要求 License 的對象必須在處置或完成物件時呼叫 Dispose 方法來處置授權。

另請參閱

適用於