LicenseContext 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
規定何時可以使用授權物件,並提供一種取得支援其領域內授權所需的額外服務的方式。
public ref class LicenseContext : IServiceProvider
public class LicenseContext : IServiceProvider
type LicenseContext = class
interface IServiceProvider
Public Class LicenseContext
Implements IServiceProvider
- 繼承
-
LicenseContext
- 衍生
- 實作
備註
此類別提供預設 LicenseContext。 它僅實作執行時支援,不支援儲存的授權金鑰。
給繼承者的注意事項
若您想實作設計時授權支援,必須繼承此類別,並覆寫以下成員:UsageMode、、 GetSavedLicenseKey(Type, Assembly)GetService(Type)SetSavedLicenseKey(Type, String)、 。 如果你想實作儲存的授權金鑰,請覆寫 GetSavedLicenseKey(Type, Assembly) and SetSavedLicenseKey(Type, String) 方法。
建構函式
| 名稱 | Description |
|---|---|
| LicenseContext() |
初始化 LicenseContext 類別的新執行個體。 |
屬性
| 名稱 | Description |
|---|---|
| UsageMode |
當在衍生類別中覆寫時,會得到一個值,指定何時可以使用授權。 |
方法
| 名稱 | Description |
|---|---|
| Equals(Object) |
判斷指定的 物件是否等於目前的物件。 (繼承來源 Object) |
| GetHashCode() |
做為預設雜湊函式。 (繼承來源 Object) |
| GetSavedLicenseKey(Type, Assembly) |
當在衍生類別中覆寫時,會回傳指定類型的授權金鑰,該授權金鑰來自指定的資源組合。 |
| GetService(Type) |
如果有服務,他會得到所要求的服務。 |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| SetSavedLicenseKey(Type, String) |
當在派生類別中覆寫時,會為指定型別設定一個授權金鑰。 |
| ToString() |
傳回表示目前 物件的字串。 (繼承來源 Object) |