Compartilhar via


IVsRunningDocTableEvents4.OnBeforeFirstDocumentLock Method

Definition

Called before a document is locked in the Running Document Table (RDT) for the first time.

public:
 int OnBeforeFirstDocumentLock(Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ pHier, System::UInt32 itemid, System::String ^ pszMkDocument);
public:
 int OnBeforeFirstDocumentLock(Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ pHier, unsigned int itemid, Platform::String ^ pszMkDocument);
int OnBeforeFirstDocumentLock(Microsoft::VisualStudio::Shell::Interop::IVsHierarchy const & pHier, unsigned int itemid, std::wstring const & pszMkDocument);
public int OnBeforeFirstDocumentLock (Microsoft.VisualStudio.Shell.Interop.IVsHierarchy pHier, uint itemid, string pszMkDocument);
abstract member OnBeforeFirstDocumentLock : Microsoft.VisualStudio.Shell.Interop.IVsHierarchy * uint32 * string -> int
Public Function OnBeforeFirstDocumentLock (pHier As IVsHierarchy, itemid As UInteger, pszMkDocument As String) As Integer

Parameters

pHier
IVsHierarchy

[in] The IVsHierarchy object that owns the document about to be locked.

itemid
UInt32

[in] The item ID in the hierarchy. This is a unique identifier or it can be one of the following values: VSITEMID_NIL, VSITEMID_ROOT, or VSITEMID_SELECTION.

pszMkDocument
String

[in] The path to the document about to be locked.

Returns

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

Remarks

COM Signature

From vsshell80.idl:

[C++]

HRESULT IVsRunningDocTableEvents4::OnBeforeFirstDocumentLock(  
   [in] IVsHierarchy* pHier,   
   [in] VSITEMID itemid   
);  

This event can be used to make sure the document about to be locked is actually present on disk. For example, this event can give Source Control a chance to download the specified file from the source control database before it is locked and opened.

Applies to