Export (0) Print
Expand All

EditorFactory.CreateEditorInstance Method

Used by the EditorFactory class to create the Visual Studio core editor, an editor that supports data/view separation.

This method is not CLS-compliant.  

Namespace: Microsoft.VisualStudio.Package
Assembly: Microsoft.VisualStudio.Package.LanguageService (in microsoft.visualstudio.package.languageservice.dll)

public virtual int CreateEditorInstance (
	uint createDocFlags,
	string moniker,
	string physicalView,
	IVsHierarchy pHier,
	uint itemid,
	IntPtr existingDocData,
	out IntPtr docView,
	out IntPtr docData,
	out string editorCaption,
	out Guid cmdUI,
	out int cancelled
)
public int CreateEditorInstance (
	UInt32 createDocFlags, 
	String moniker, 
	String physicalView, 
	IVsHierarchy pHier, 
	UInt32 itemid, 
	IntPtr existingDocData, 
	/** @attribute OutAttribute() */ /** @ref */ IntPtr docView, 
	/** @attribute OutAttribute() */ /** @ref */ IntPtr docData, 
	/** @attribute OutAttribute() */ /** @ref */ String editorCaption, 
	/** @attribute OutAttribute() */ /** @ref */ Guid cmdUI, 
	/** @attribute OutAttribute() */ /** @ref */ int cancelled
)
JScript does not support passing value-type arguments by reference.

Parameters

createDocFlags

Flags that define the conditions under which to create the core editor.

moniker

String form of the moniker identifier of the document in the project system. In the case of documents that are files, this is always the path to the file. This parameter can also be used to specify documents that are not files. For example, in a database-oriented project, this parameter could contain a string that refers to records in a table.

physicalView

Name of the physical view.

pHier

An IVsHierarchy object.

itemid

Item identifier of the core editor instance.

existingDocData

Must be the docData object that is registered in the Running Document Table (RDT). This parameter is used to determine if a document buffer (Document Data object) has already been created. When an editor factory is asked to create a secondary view, then this parameter will be non-NULL indicating that there is no document buffer.

docView

Document View object. Returns NULL if an external editor exists, otherwise returns the view of the document.

docData

Document Data object. Returns the buffer for the document.

editorCaption

Initial caption defined by the document editor for the document window. This is typically a string enclosed in square brackets, such as "[Form]". This value is passed as an input parameter to the CreateDocumentWindow method. If the file is [ReadOnly] the caption will be set during load of the file.

cmdUI

Returns the Command UI GUID. This GUID is active when this editor is activated. Any UI element that is visible in the editor has to use this GUID. This GUID is used in the .ctc file in the satellite DLL where it indicates which menus and toolbars should be displayed when the document is active.

cancelled

Enumeration of type __VSEDITORCREATEDOCWIN. These flags are passed to CreateDocumentWindow Method. This value is set to 0 in EditorFactory implementation.

Return Value

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

The Visual Studio core editor is the primary command handler.

Community Additions

ADD
Show:
© 2014 Microsoft