Share via


RunningDocumentTable.FindDocument Method

Definition

Gets information about a specific document from the Running Document Table (RDT).

Overloads

FindDocument(String)

Gets an object from the Running Document Table (RDT) that represents the document specified by the given path.

FindDocument(String, UInt32)

Gets a cookie from the Running Document Table (RDT) that represents the document specified by the given path.

FindDocument(String, IVsHierarchy, UInt32, UInt32)

Gets an object, cookie, and owning project type from the Running Document Table (RDT) for the document specified by the given path.

Remarks

Given the path to the document file, the RDT can obtain information about that document such as the owning project or the cookie associated with the document. The RDT uses unique values called cookies to track each individual document.

FindDocument(String)

Gets an object from the Running Document Table (RDT) that represents the document specified by the given path.

public:
 System::Object ^ FindDocument(System::String ^ moniker);
public:
 Platform::Object ^ FindDocument(Platform::String ^ moniker);
winrt::Windows::Foundation::IInspectable FindDocument(std::wstring const & moniker);
public object FindDocument (string moniker);
member this.FindDocument : string -> obj
Public Function FindDocument (moniker As String) As Object

Parameters

moniker
String

[in] Path to the desired document.

Returns

An object that can be cast to an appropriate interface to access the document (see Remarks for details), or null if the document is not registered with Visual Studio.

Remarks

The object returned can typically be cast to the IVsPersistDocData interface or the IVsDocDataFileChangeControl interface.

Applies to

FindDocument(String, UInt32)

Gets a cookie from the Running Document Table (RDT) that represents the document specified by the given path.

public:
 System::Object ^ FindDocument(System::String ^ moniker, [Runtime::InteropServices::Out] System::UInt32 % docCookie);
winrt::Windows::Foundation::IInspectable FindDocument(std::wstring const & moniker, [Runtime::InteropServices::Out] unsigned int & docCookie);
public object FindDocument (string moniker, out uint docCookie);
member this.FindDocument : string * uint32 -> obj
Public Function FindDocument (moniker As String, ByRef docCookie As UInteger) As Object

Parameters

moniker
String

[in] Path to the desired document.

docCookie
UInt32

[out] Returns the unique value that represents the requested document in the RDT.

Returns

An object that can be cast to an appropriate interface to access the document (see Remarks for details), or null if the document is not registered with Visual Studio.

Remarks

The cookie can be used in a call to the GetRunningDocumentContents method.

The object returned can typically be cast to the IVsPersistDocData interface or the IVsDocDataFileChangeControl interface.

Applies to

FindDocument(String, IVsHierarchy, UInt32, UInt32)

Gets an object, cookie, and owning project type from the Running Document Table (RDT) for the document specified by the given path.

public:
 System::Object ^ FindDocument(System::String ^ moniker, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ % hierarchy, [Runtime::InteropServices::Out] System::UInt32 % itemid, [Runtime::InteropServices::Out] System::UInt32 % docCookie);
winrt::Windows::Foundation::IInspectable FindDocument(std::wstring const & moniker, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsHierarchy const & & hierarchy, [Runtime::InteropServices::Out] unsigned int & itemid, [Runtime::InteropServices::Out] unsigned int & docCookie);
public object FindDocument (string moniker, out Microsoft.VisualStudio.Shell.Interop.IVsHierarchy hierarchy, out uint itemid, out uint docCookie);
member this.FindDocument : string * IVsHierarchy * uint32 * uint32 -> obj
Public Function FindDocument (moniker As String, ByRef hierarchy As IVsHierarchy, ByRef itemid As UInteger, ByRef docCookie As UInteger) As Object

Parameters

moniker
String

[in] Path to the desired document.

hierarchy
IVsHierarchy

[out] Returns an IVsHierarchy object that represents the project that owns the requested document.

itemid
UInt32

[out] Returns the ID of the document in the IVsHierarchy object.

docCookie
UInt32

[out] Returns the unique value that represents the requested document in the RDT.

Returns

An object that can be cast to an appropriate interface to access the document (see Remarks for details). If a null value is returned, the document is not registered with Visual Studio.

Remarks

The cookie can be used in a call to the GetRunningDocumentContents method.

The object returned can typically be cast to the IVsPersistDocData interface or the IVsDocDataFileChangeControl interface.

Applies to