LicenseContext 類別

定義

指定您何時可以使用授權的物件,並提供方法來取得在其網域中執行支援授權所需的其他服務。

public ref class LicenseContext : IServiceProvider
public class LicenseContext : IServiceProvider
type LicenseContext = class
    interface IServiceProvider
Public Class LicenseContext
Implements IServiceProvider
繼承
LicenseContext
衍生
實作

備註

這個類別提供預設 LicenseContext 。 它只會實作執行時間支援,且不支援已儲存的授權金鑰。

給繼承者的注意事項

如果您想要實作設計階段授權支援,您必須繼承自這個類別,並覆寫下列成員: UsageModeGetSavedLicenseKey(Type, Assembly)GetService(Type)SetSavedLicenseKey(Type, String) 。 如果您想要實作儲存的授權金鑰,請覆寫 GetSavedLicenseKey(Type, Assembly)SetSavedLicenseKey(Type, String) 方法。

如需授權的詳細資訊,請參閱 如何:授權元件和控制項

建構函式

LicenseContext()

初始化 LicenseContext 類別的新執行個體。

屬性

UsageMode

在衍生類別中覆寫時,取得當您可以使用授權時所指定的值。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetSavedLicenseKey(Type, Assembly)

在衍生類別中覆寫時,從指定的資源組件 (Assembly) 傳回指定型別的已儲存授權識別碼。

GetService(Type)

如果有可用的服務,則取得所要求的服務。

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
SetSavedLicenseKey(Type, String)

在衍生類別中覆寫時,為指定的型別設定授權識別碼。

ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於

另請參閱