IVsInvisibleEditor.GetDocData Method
Obtains the document data for the file "under edit" by this editor object.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
'Declaration
Function GetDocData ( _
fEnsureWritable As Integer, _
ByRef riid As Guid, _
<OutAttribute> ByRef ppDocData As IntPtr _
) As Integer
int GetDocData(
int fEnsureWritable,
ref Guid riid,
out IntPtr ppDocData
)
int GetDocData(
[InAttribute] int fEnsureWritable,
[InAttribute] Guid% riid,
[OutAttribute] IntPtr% ppDocData
)
abstract GetDocData :
fEnsureWritable:int *
riid:Guid byref *
ppDocData:IntPtr byref -> int
function GetDocData(
fEnsureWritable : int,
riid : Guid,
ppDocData : IntPtr
) : int
Parameters
fEnsureWritable
Type: System.Int32BOOLEAN indicating whether the document data is writable.
riid
Type: System.Guid%GUID of the editor object.
ppDocData
Type: System.IntPtr%Pointer to the document data.
Return Value
Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
COM Signature
From vsshell.idl:
HRESULT IVsInvisibleEditor::GetDocData(
[in] BOOL fEnsureWritable,
[in] REFIID riid,
[out, iid_is(riid)] void **ppDocData
);
If the file is not already open, the editor factory registered with this editor is used; the default text-file loader is used if NULL was registered in the editor factory. If the file is already in the RDT, it will simply be query interfaced for the given interface and returned. Editors should use this function each time they need access to the document data, as opposed to caching the document data object, since in that case it may get removed from the RDT and re-loaded into a new document data object. If the caller intends to modify the document, they should pass TRUE for fEnsureWritable, which queries the user for checking the file out as appropriate if it is under source code control.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.