C# Class XSharp.Project.VOEditorFactoryBase

Factory for creating our editor object. Extends from the IVsEditoryFactory interface
Inheritance: IVsEditorFactory, IDisposable
Mostra file Open project: X-Sharp/XSharpPublic

Protected Properties

Property Type Description
editorPackage XSharpProjectPackage

Public Methods

Method Description
Close ( ) : int
CreateEditorInstance ( uint grfCreateDoc, string pszMkDocument, string pszPhysicalView, IVsHierarchy pvHier, uint itemid, System punkDocDataExisting, System &ppunkDocView, System &ppunkDocData, string &pbstrEditorCaption, System.Guid &pguidCmdUI, int &pgrfCDW ) : int

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.

Dispose ( ) : void

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.

GetService ( Type serviceType ) : object
MapLogicalView ( System.Guid &rguidLogicalView, string &pbstrPhysicalView ) : int
SetSite ( Microsoft psp ) : int

Used for initialization of the editor in the environment

Protected Methods

Method Description
CalledFromVulcanDLL ( ) : bool
GetProjectNode ( string fileName ) : object
GetVulcanFactory ( string className, string fileName ) : object

Private Methods

Method Description
VOEditorFactoryBase ( ) : System

Method Details

CalledFromVulcanDLL() protected method

protected CalledFromVulcanDLL ( ) : bool
return bool

Close() public method

public Close ( ) : int
return int

CreateEditorInstance() abstract public method

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.
abstract public CreateEditorInstance ( uint grfCreateDoc, string pszMkDocument, string pszPhysicalView, IVsHierarchy pvHier, uint itemid, System punkDocDataExisting, System &ppunkDocView, System &ppunkDocData, string &pbstrEditorCaption, System.Guid &pguidCmdUI, int &pgrfCDW ) : int
grfCreateDoc uint 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 uint Item identifier of this editor instance
punkDocDataExisting System This parameter is used to determine if a document buffer /// (DocData object) has already been created ///
ppunkDocView System Pointer to the IUnknown interface for the DocView object
ppunkDocData System Pointer to the IUnknown interface for the DocData object
pbstrEditorCaption string Caption mentioned by the editor for the doc window
pguidCmdUI System.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 int Flags for CreateDocumentWindow
return int

Dispose() public method

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 Dispose ( ) : void
return void

GetProjectNode() protected method

protected GetProjectNode ( string fileName ) : object
fileName string
return object

GetService() public method

public GetService ( Type serviceType ) : object
serviceType System.Type
return object

GetVulcanFactory() protected method

protected GetVulcanFactory ( string className, string fileName ) : object
className string
fileName string
return object

MapLogicalView() public method

public MapLogicalView ( System.Guid &rguidLogicalView, string &pbstrPhysicalView ) : int
rguidLogicalView System.Guid
pbstrPhysicalView string
return int

SetSite() public method

Used for initialization of the editor in the environment
public SetSite ( Microsoft psp ) : int
psp Microsoft pointer to the service provider. Can be used to obtain instances of other interfaces ///
return int

Property Details

editorPackage protected_oe property

protected XSharpProjectPackage,XSharp.Project editorPackage
return XSharpProjectPackage