共用方式為


ProvideAutoLoadAttribute 類別

定義

這個屬性會將封裝註冊為擴充項。 傳入的 GUID 會決定要擴充的內容。 封裝上的屬性不會控制封裝的行為,但註冊工具可以使用它們向Visual Studio註冊適當的資訊。

public ref class ProvideAutoLoadAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
public ref class ProvideAutoLoadAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
public sealed class ProvideAutoLoadAttribute : Microsoft.VisualStudio.Shell.RegistrationAttribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)>]
type ProvideAutoLoadAttribute = class
    inherit RegistrationAttribute
Public NotInheritable Class ProvideAutoLoadAttribute
Inherits RegistrationAttribute
繼承
ProvideAutoLoadAttribute
屬性

備註

將此屬性套用至繼承自 Package 或 實作 IVsPackage 的 VSPackage 類別,以在指定的 UI 內容為使用中時自動載入您的類別。

這個屬性會使 VSPackage 成為擴充項, (實 IExtenderProvider 作) 的物件。 傳遞至建構函式的 GUID 會決定封裝載入的內容。

這個屬性類別僅用於提供外部註冊工具的數據。 它不會影響 VSPackage 的運行時間行為。

注意

Visual C# 會自動將 “Attribute” 這個字附加至任何屬性類別的名稱。 在 Visual C# 程式代碼中,將此屬性 ProvideAutoLoad稱為 。

注意

Visual C# 和 Visual Basic 專案類型的 GUID 分別是 {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 和 {F184B08F-C81C-45F6-A57F-5ABD9991F28F}。

登錄項目

下列登入專案是由 ProvideAutoLoadAttribute所建立:

  • <VSROOT>\AutoLoadPackages\{ContextGuid}

  • <VSROOT>\AutoLoadPackages\{ContextGuid}\{PackageGuid}=0

建構函式

ProvideAutoLoadAttribute(String)

指定當此內容為使用中時,應該載入套件。

ProvideAutoLoadAttribute(String, PackageAutoLoadFlags)

指定當此內容為使用中時,應該載入套件。

屬性

Flags

指定封裝自動載入項目的選項

LoadGuid

觸發封裝載入的內容 GUID。

TypeId

覆寫 TypeID 屬性,讓 RegistrationAttribute 衍生類別搭配 System.ComponentModel.TypeDescriptor.GetAttributes (...) 。衍生自這個屬性的屬性只有在需要對可套用至類別的實例有更好的控制權時,才必須覆寫此屬性。

(繼承來源 RegistrationAttribute)

方法

GetPackageRegKeyPath(Guid)

取得相對於 VSPackage 之應用程式) 之登錄根目錄的登錄路徑 (。

(繼承來源 RegistrationAttribute)
Register(RegistrationAttribute+RegistrationContext)

呼叫以註冊這個具有指定內容的屬性。 內容,其中包含用來放置註冊資訊的位置。 它也包含註冊的類型和路徑資訊。

Unregister(RegistrationAttribute+RegistrationContext)

取消註冊此自動載入規格。

適用於