Package.RegisterEditorFactory Method
Registers an editor factory with Visual Studio.
Namespace: Microsoft.VisualStudio.Shell
Assembly: Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
Syntax
'宣言
Protected Sub RegisterEditorFactory ( _
factory As IVsEditorFactory _
)
'使用
Dim factory As IVsEditorFactory
Me.RegisterEditorFactory(factory)
protected void RegisterEditorFactory(
IVsEditorFactory factory
)
protected:
void RegisterEditorFactory(
IVsEditorFactory^ factory
)
protected function RegisterEditorFactory(
factory : IVsEditorFactory
)
Parameters
factory
Type: Microsoft.VisualStudio.Shell.Interop.IVsEditorFactoryThe editor factory to register.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | factory is a null reference (Nothing in Visual Basic). |
Remarks
To register an editor factory for a VSPackage, perform the following steps:
Add a RegisterEditorExtensionAttribute to your Package class.
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.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Concepts
How to: Register Editor Factories