RegisterEditorExtensionAttribute(Object, String, Int32) Constructor

Definition

Initializes a new RegisterEditorExtensionAttribute for the supplied factory type and extension.

public:
 RegisterEditorExtensionAttribute(System::Object ^ factoryType, System::String ^ extension, int priority);
public:
 RegisterEditorExtensionAttribute(Platform::Object ^ factoryType, Platform::String ^ extension, int priority);
 RegisterEditorExtensionAttribute(winrt::Windows::Foundation::IInspectable const & factoryType, std::wstring const & extension, int priority);
public RegisterEditorExtensionAttribute (object factoryType, string extension, int priority);
new Microsoft.VisualStudio.Shell.RegisterEditorExtensionAttribute : obj * string * int -> Microsoft.VisualStudio.Shell.RegisterEditorExtensionAttribute
Public Sub New (factoryType As Object, extension As String, priority As Integer)

Parameters

factoryType
Object

One of following types:The type of the editor factory expressed as a string.The GUID of the editor factory.The type of the editor factory.

extension
String

The file extension to associate with the editor factory. This extension should include the prefix ".".

priority
Int32

The priority of this editor factory. Editors with higher priority numbers are given a chance to read a file first. Upon failure, the next editor in priority order is used.

Exceptions

This method throws an ArgumentNullException if:Factory GUID value passed in factoryType is null. extension is null.

This method throws an ArgumentException if:The factory GUID string cannot be converted to a GUID object. Extension does not begin with a ".".

Examples

The following C# code applies the RegisterEditorExtension attribute to a VSPackage named BasicEditor.

using Microsoft.VisualStudio.Shell;  
using MSVSIP = Microsoft.VisualStudio.Shell;  
[MSVSIP.RegisterEditorExtension(typeof(EditorFactory), ".myext", 32, "{A2FE74E1-B743-11d0-AE1A-00A0C90FFFC3}", "..\\..\\Templates", 106)]  
public class BasicEditor : MSVSIP.Package {}  

Remarks

This constructor is useful if you do not have access to the editor factory because it is implemented elsewhere.

Applies to