EntityEditorFactory

Entity editor factory.

Namespace:
KpokEntityTool.Editors
Type:
Class
Public:
Yes
Protected:
No
Sealed:
Yes
Abstract:
No
Inherits from:
System.Object
Implements:
Microsoft.VisualStudio.Shell.Interop.IVsEditorFactory, System.IDisposable

Constructors

EntityEditorFactory

Default constructor

Signature:
public Void EntityEditorFactory()

Methods

Close

Close.

Signature:
public Int32 Close()

CreateEditorInstance

Used by the editor factory to create an editor instance. The environment first determines the editor factory with the highest priority for opening the file and then calls IVsEditorFactory.CreateEditorInstance. If the environment is unable to instantiate the document data in that editor, it will find the editor with the next highest priority and attempt to so that same thing. NOTE: The priority of our editor is 32 as mentioned in the attributes on the package class. Since our editor supports opening only a single view for an instance of the document data, if we are requested to open document data that is already instantiated in another editor, or even our editor, we return a value VS_E_INCOMPATIBLEDOCDATA.

Signature:
public Int32 CreateEditorInstance(grfCreateDoc, pszMkDocument, pszPhysicalView, pvHier, itemid, punkDocDataExisting, ppunkDocView, ppunkDocData, pbstrEditorCaption, pguidCmdUI, pgrfCDW)
Parameters
Name Type Summary
grfCreateDoc UInt32 Flags determining when to create the editor. Only open and silent flags are valid
pszMkDocument String path to the file to be opened
pszPhysicalView String name of the physical view
pvHier IVsHierarchy pointer to the IVsHierarchy interface
itemid UInt32 Item identifier of this editor instance
punkDocDataExisting IntPtr This parameter is used to determine if a document buffer (DocData object) has already been created
ppunkDocView IntPtr@ Pointer to the IUnknown interface for the DocView object
ppunkDocData IntPtr@ Pointer to the IUnknown interface for the DocData object
pbstrEditorCaption String@ Caption mentioned by the editor for the doc window
pguidCmdUI Guid@ The Command UI Guid. Any UI element that is visible in the editor has to use this GUID. This is specified in the .vsct file
pgrfCDW Int32@ Flags for CreateDocumentWindow

Dispose

Since we create a ServiceProvider which implements IDisposable we also need to implement IDisposable to make sure that the ServiceProvider's Dispose method gets called.

Signature:
public Void Dispose()

MapLogicalView

Maps the logical views for the editor.

Signature:
public Int32 MapLogicalView(rguidLogicalView, pbstrPhysicalView)
Parameters
Name Type Summary
rguidLogicalView Guid@
pbstrPhysicalView String@

SetSite

Used for initialization of the editor in the environment.

Signature:
public Int32 SetSite(psp)
Parameters
Name Type Summary
psp IServiceProvider Pointer to the service provider. Can be used to obtain instances of other interfaces.