Package.RegisterEditorFactory Method (IVsEditorFactory)


Registers an editor factory with Visual Studio.

Namespace:   Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)

protected void RegisterEditorFactory(
	IVsEditorFactory factory


Type: Microsoft.VisualStudio.Shell.Interop.IVsEditorFactory

The editor factory to register.

Exception Condition

factory is null.

To register an editor factory for a VSPackage, perform the following steps:

  1. Add a RegisterEditorExtensionAttribute to your Package class.

  2. Override the Initialize method. In your implementation of the Initialize method, call the RegisterEditorFactory method and pass the instance of your editor factory.

Editor factories are automatically unregistered when the package is disposed. If the editor factory object implements IDisposable, its Dispose method is called after the factory has been unregistered with Visual Studio.

Return to top