Share via


EditorFactory Class

Definition

Important

This API is not CLS-compliant.

You must inherit from this class and simply add a [ComVisible] and [GuidAttribute] and then specify the EditorFactoryGuid, EditorFactoryGuid and EditorName variables in your Registration class. This base class provides a default editor factory implementation that hosts the Visual Studio Core editor.

public ref class EditorFactory : Microsoft::VisualStudio::Shell::Interop::IVsEditorFactory
[Windows::Foundation::Metadata::WebHostHidden]
class EditorFactory : Microsoft::VisualStudio::Shell::Interop::IVsEditorFactory
[System.CLSCompliant(false)]
[System.Runtime.InteropServices.ComVisible(true)]
public class EditorFactory : Microsoft.VisualStudio.Shell.Interop.IVsEditorFactory
[System.Runtime.InteropServices.ComVisible(true)]
public class EditorFactory : Microsoft.VisualStudio.Shell.Interop.IVsEditorFactory
[<System.CLSCompliant(false)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type EditorFactory = class
    interface IVsEditorFactory
[<System.Runtime.InteropServices.ComVisible(true)>]
type EditorFactory = class
    interface IVsEditorFactory
Public Class EditorFactory
Implements IVsEditorFactory
Inheritance
EditorFactory
Attributes
Implements

Remarks

Inherit from this class and add the [ComVisible] and [Guid] attributes, and then specify the EditorFactoryGuid, EditorFactoryGuid and EditorName variables in your Registration class.

Constructors

EditorFactory()

Initializes a new instance of EditorFactory.

EditorFactory(Package)

Creates an instance of the EditorFactory class.

Fields

GuidVSBufferDetectLangSid

Gets a GUID value in IVsUserData that, when set to false, will stop the core editor for searching for a different language service.

Properties

CodePagePrompt

Gets and sets flags to prompt user for an encoding on an open with specified codepage.

Methods

Close()

Releases all service provides and sets the package object to null.

CreateEditorInstance(UInt32, String, String, IVsHierarchy, UInt32, IntPtr, IntPtr, IntPtr, String, Guid, Int32)

This method checks to see if the specified file is one that your editor supports and if so, creates the core text editor and associated your language service with it. To figure out if the file is one that your editor supports it performs the following check:

If all this is true then it goes ahead with the next step which is to get an IVsTextLines buffer and set it up as follows:

Lastly it calls CreateEditorView to create the docView.

CreateEditorView(String, IVsTextLines, String, String, Guid)

Return docView IUnknown COM object.

Finalize()

Destructor for the class.

GetExtensions()

Return list of file extensions registered for this editor factory under HKLM\Software\Microsoft\Visual Studio\8.0\Editors\{" + this.GetType().GUID.ToString() + "}\Extensions

GetLanguageService(String)

Returns the guid of the language service registered for this file extension HKLM\Software\Microsoft\Visual Studio\8.0\Language Services\Extensions

GetLanguageServiceGuid()

Gets the language service GUID.

GetPackage()

Gets the Package object.

GetRegisteredEditor(String)

Returns the guid of the highest priority editor registered for this extension. This will also pick up user defined file extension to editor associations

GetRegisteredEditorInfo(String)

Returns the guid of the highest priority editor registered for this extension. This will also pick up user defined file extension to editor associations. You can then access all registered editors via the .Next property.

GetSite()

Gets the main service provider.

GetUserDefinedEditor(String)

Returns the guid of the editor that the user has defined for this file extension or Guid.Empty if none is found

IsOurFileFormat(String)

Checks whether there is an editor that can handle this extension.

IsRegisteredExtension(String)

Returns true if the given extension is one of our registered extensions

MapLogicalView(Guid, String)

Maps a logical view to a physical view.

SetSite(IServiceProvider)

Sets the service provider.

Applies to