Export (0) Print
Expand All

EditorFactory.CreateEditorInstance Method

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

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)

public function CreateEditorInstance(
	createDocFlags : uint, 
	moniker : String, 
	physicalView : String, 
	pHier : IVsHierarchy, 
	itemid : uint, 
	existingDocData : IntPtr, 
	docView : IntPtr, 
	docData : IntPtr, 
	editorCaption : String, 
	cmdUI : Guid, 
	cancelled : int
) : int

Parameters

createDocFlags
Type: System.UInt32
Flags that define the conditions under which to create the core editor.
moniker
Type: System.String
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
Type: System.String
Name of the physical view.
pHier
Type: Microsoft.VisualStudio.Shell.Interop.IVsHierarchy
An IVsHierarchy object.
itemid
Type: System.UInt32
Item identifier of the core editor instance.
existingDocData
Type: System.IntPtr
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
Type: System.IntPtr
Document View object. Returns NULL if an external editor exists, otherwise returns the view of the document.
docData
Type: System.IntPtr
Document Data object. Returns the buffer for the document.
editorCaption
Type: System.String
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
Type: System.Guid
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
Type: System.Int32
Enumeration of type __VSEDITORCREATEDOCWIN. These flags are passed to CreateDocumentWindow Method. This value is set to 0 in the EditorFactory implementation.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Implements

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

The Visual Studio core editor is the primary command handler.

Community Additions

ADD
Show:
© 2014 Microsoft