다음을 통해 공유


IVsUIShellOpenDocument4.IsDocumentInAProject2 Method

Definition

Determines whether the specified document is in a project.

public:
 int IsDocumentInAProject2(System::String ^ pszMkDocument, bool fSupportExternalItems, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsUIHierarchy ^ % ppUIH, [Runtime::InteropServices::Out] System::UInt32 % pitemid, [Runtime::InteropServices::Out] Microsoft::VisualStudio::OLE::Interop::IServiceProvider ^ % ppSP);
int IsDocumentInAProject2(std::wstring const & pszMkDocument, bool fSupportExternalItems, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsUIHierarchy const & & ppUIH, [Runtime::InteropServices::Out] unsigned int & pitemid, [Runtime::InteropServices::Out] Microsoft::VisualStudio::OLE::Interop::IServiceProvider const & & ppSP);
public int IsDocumentInAProject2 (string pszMkDocument, bool fSupportExternalItems, out Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy ppUIH, out uint pitemid, out Microsoft.VisualStudio.OLE.Interop.IServiceProvider ppSP);
abstract member IsDocumentInAProject2 : string * bool * IVsUIHierarchy * uint32 * IServiceProvider -> int
Public Function IsDocumentInAProject2 (pszMkDocument As String, fSupportExternalItems As Boolean, ByRef ppUIH As IVsUIHierarchy, ByRef pitemid As UInteger, ByRef ppSP As IServiceProvider) As Integer

Parameters

pszMkDocument
String

[in] String form of the unique moniker identifier of the document in the project system, for example, the full path to the file. In non-file cases, this identifier is often in the form of a URL.

fSupportExternalItems
Boolean

true if the project supports external items, otherwise false.

ppUIH
IVsUIHierarchy

out] If the document is open, this is a pointer to the IVsUIHierarchy interface implementation of the project that contains the document. If the document is not open, the value of this parameter is null. You can call Query Interface From IVsUIHierarchy to obtain a pointer to the IVsHierarchy interface of the project.

pitemid
UInt32

[out] Pointer to the hierarchy item identifier of the document in the project system. For more information see VSITEMID.

ppSP
IServiceProvider

[out] Pointer to the IServiceProvider interface for the project

Returns

Specifies whether the document is in a project.

Remarks

This is the same as IVsUIShellOpenDocument.IsDocumentInAProject() except that it can support finding documents in a hierarchy that aren't in the hierarchy's physical project but can be associated with the hierarchy via IVsUIHierarchy.ParseCanonicalName() and the item's VSHPROPID_ExternalItem property is true.

Applies to