Entity editor factory.
Default constructor
public Void EntityEditorFactory()
Close.
public Int32 Close()
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.
public Int32 CreateEditorInstance(grfCreateDoc, pszMkDocument, pszPhysicalView, pvHier, itemid, punkDocDataExisting, ppunkDocView, ppunkDocData, pbstrEditorCaption, pguidCmdUI, pgrfCDW)
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 |
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.
public Void Dispose()
Maps the logical views for the editor.
public Int32 MapLogicalView(rguidLogicalView, pbstrPhysicalView)
Name | Type | Summary |
---|---|---|
rguidLogicalView | Guid@ | |
pbstrPhysicalView | String@ |
Used for initialization of the editor in the environment.
public Int32 SetSite(psp)
Name | Type | Summary |
---|---|---|
psp | IServiceProvider | Pointer to the service provider. Can be used to obtain instances of other interfaces. |
In this document