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.

給繼承者的注意事項

如果您想要執行設計階段授權支援,您必須繼承自這個類別,並覆寫下列成員: UsageModeGetSavedLicenseKey(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)

在衍生類別中覆寫時,從指定的資源組件 (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()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於

另請參閱