次の方法で共有


IVsInvisibleEditorManager.RegisterInvisibleEditor Method

Definition

Registers an invisible editor on the specified document.

public:
 int RegisterInvisibleEditor(System::String ^ pszMkDocument, Microsoft::VisualStudio::Shell::Interop::IVsProject ^ pProject, System::UInt32 dwFlags, Microsoft::VisualStudio::Shell::Interop::IVsSimpleDocFactory ^ pFactory, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsInvisibleEditor ^ % ppEditor);
public:
 int RegisterInvisibleEditor(Platform::String ^ pszMkDocument, Microsoft::VisualStudio::Shell::Interop::IVsProject ^ pProject, unsigned int dwFlags, Microsoft::VisualStudio::Shell::Interop::IVsSimpleDocFactory ^ pFactory, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsInvisibleEditor ^ &  ppEditor);
int RegisterInvisibleEditor(std::wstring const & pszMkDocument, Microsoft::VisualStudio::Shell::Interop::IVsProject const & pProject, unsigned int dwFlags, Microsoft::VisualStudio::Shell::Interop::IVsSimpleDocFactory const & pFactory, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsInvisibleEditor const & & ppEditor);
public int RegisterInvisibleEditor (string pszMkDocument, Microsoft.VisualStudio.Shell.Interop.IVsProject pProject, uint dwFlags, Microsoft.VisualStudio.Shell.Interop.IVsSimpleDocFactory pFactory, out Microsoft.VisualStudio.Shell.Interop.IVsInvisibleEditor ppEditor);
abstract member RegisterInvisibleEditor : string * Microsoft.VisualStudio.Shell.Interop.IVsProject * uint32 * Microsoft.VisualStudio.Shell.Interop.IVsSimpleDocFactory * IVsInvisibleEditor -> int
Public Function RegisterInvisibleEditor (pszMkDocument As String, pProject As IVsProject, dwFlags As UInteger, pFactory As IVsSimpleDocFactory, ByRef ppEditor As IVsInvisibleEditor) As Integer

Parameters

pszMkDocument
String

The name of the document.

pProject
IVsProject

The project to which the file must belong. If null is supplied, the file can belong to any project; when opened, it is opened by whichever project responds to IsDocumentInAProject from the shell (including the miscellaneous files project).

dwFlags
UInt32

Zero or more _EDITORREGFLAGS values; If REIF_ENABLECACHING flag is set, the document is loaded and placed in the RDT immediately, if not already present, and attempts are made to keep the document there as long as possible; certain actions may force it to be unlocked, such as user closing without saving, etc. This allows the document to stay in the RDT in the scenario where a document is open in a visible editor, and closed by the user while an invisible editor is registered for that document. Otherwise, the document is not loaded until GetDocData(Int32, Guid, IntPtr) is called (unless. of course, it is already in memory), and no unnecessary attempts to keep the document in the RDT while this editor is registered are made.

pFactory
IVsSimpleDocFactory

An instance of IVsSimpleDocFactory that is used to load the document if it isn't already open. If null is supplied, a default editor factory is used to load the file into a shell-provided instance of IVsTextLines.

ppEditor
IVsInvisibleEditor

Filled with the newly created and registered invisible editor instance.

Returns

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsInvisibleEditorManager::RegisterInvisibleEditor(  
   [in] LPCOLESTR pszMkDocument,   
   [in] IVsProject *pProject,   
   [in] EDITORREGFLAGS dwFlags,   
   [in] IVsSimpleDocFactory *pFactory,   
   [out] IVsInvisibleEditor **ppEditor  
);  

Applies to