RegisterEditorExtensionAttribute 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
RegisterEditorExtensionAttribute has been deprecated. Please use ProvideEditorExtensionAttribute instead.
請參閱 ProvideEditorExtensionAttribute。 向指定的編輯器處理站註冊擴展名。 此類別無法獲得繼承。
public ref class RegisterEditorExtensionAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
public ref class RegisterEditorExtensionAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
[System.Obsolete("RegisterEditorExtensionAttribute has been deprecated. Please use ProvideEditorExtensionAttribute instead.")]
public sealed class RegisterEditorExtensionAttribute : Microsoft.VisualStudio.Shell.RegistrationAttribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)>]
[<System.Obsolete("RegisterEditorExtensionAttribute has been deprecated. Please use ProvideEditorExtensionAttribute instead.")>]
type RegisterEditorExtensionAttribute = class
inherit RegistrationAttribute
Public NotInheritable Class RegisterEditorExtensionAttribute
Inherits RegistrationAttribute
- 繼承
- 屬性
備註
呼叫時機
將 RegisterEditorExtensionAttribute 屬性套用至實作編輯器處理站的類別
基本使用方式
這個屬性會將擴展名與指定的編輯器處理站產生關聯。 擴展名應該包含前置詞 “.”。
此屬性僅用於註冊用途,且不會影響運行時間行為。 它應該放在封裝類別上。
每個編輯器處理站也有相關聯的優先順序。 針對指定的擴展名,具有最高優先順序數位的編輯器有機會先讀取檔案。 如果編輯器無法讀取檔案,則會依優先順序使用其餘編輯器。 若要使用 RegisterEditorExtensionAttribute,請將它放在封裝類別上,例如 Package 或 IVsPackage。
登錄項目
下列登入專案是由 所 RegisterEditorExtensionAttribute建立:
<VSROOT>\Editors\{FactoryGuid}\Extensions\Extension=Priority
注意 Visual C# 和 Visual Basic 專案類型的 GUIDS 為:
C#: {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
VB: {F184B08F-C81C-45F6-A57F-5ABD9991F28F}
範例
您可以在 Managed 範例中找到 的 RegisterEditorExtensionAttribute 實作。 這個和用於自動註冊之所有其他屬性的標準位置,會與VsPkg.cs、VsPkg.vb或VsPkg.cpp中的 實 Package 作相鄰,視範例中使用的語言而定。
注意
C# 會自動將 Attribute 這個字附加至任何屬性類別的名稱。 在 C# 程式代碼中,將此屬性稱為 RegisterEditorExtension。
建構函式
RegisterEditorExtensionAttribute(Object, String, Int32) |
已淘汰.
初始化提供處理站類型與擴充功能的新 RegisterEditorExtensionAttribute 。 |
屬性
EditorFactoryNotify |
已淘汰.
取得或設定是否要在註冊時建立EditorFactoryNotify 登錄機碼。 |
Extension |
已淘汰.
取得檔案的擴展名。 |
Factory |
已淘汰.
取得編輯器處理站 GUID。 |
NameResourceID |
已淘汰.
取得或設定名稱資源識別碼。 |
Priority |
已淘汰.
取得此延伸模組註冊的優先順序。 |
ProjectGuid |
已淘汰.
取得或設定專案 GUID。 |
TemplateDir |
已淘汰.
取得或設定範本目錄。 |
TypeId |
已淘汰.
覆寫 TypeID 屬性,讓 RegistrationAttribute 衍生類別搭配 System.ComponentModel.TypeDescriptor.GetAttributes (...) 。衍生自這個屬性的屬性只有在需要對可套用至類別的實例有更好的控制權時,才必須覆寫此屬性。 (繼承來源 RegistrationAttribute) |
方法
GetPackageRegKeyPath(Guid) |
已淘汰.
取得相對於 VSPackage 之應用程式) 之登錄根目錄的登錄路徑 (。 (繼承來源 RegistrationAttribute) |
Register(RegistrationAttribute+RegistrationContext) |
已淘汰.
註冊編輯器擴充功能。 |
Unregister(RegistrationAttribute+RegistrationContext) |
已淘汰.
拿掉編輯器擴充功能登錄機碼。 |