Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Package.RegisterEditorFactory Method

Registers an editor factory with Visual Studio.

This method is not CLS-compliant.  

Namespace: Microsoft.VisualStudio.Shell
Assembly: Microsoft.VisualStudio.Shell (in microsoft.visualstudio.shell.dll)

protected void RegisterEditorFactory (
	IVsEditorFactory factory
protected void RegisterEditorFactory (
	IVsEditorFactory factory
protected function RegisterEditorFactory (
	factory : IVsEditorFactory



The editor factory to register.

Exception typeCondition


factory is a null reference (Nothing in Visual Basic).

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 RegisterEditorFactorymethod 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.

Community Additions

© 2015 Microsoft