次の方法で共有


IVsUIShellOpenDocument.IsSpecificDocumentViewOpen Method

Definition

Determines whether a specified document view is open.

public:
 int IsSpecificDocumentViewOpen(Microsoft::VisualStudio::Shell::Interop::IVsUIHierarchy ^ pHierCaller, System::UInt32 itemidCaller, System::String ^ pszMkDocument, Guid % rguidEditorType, System::String ^ pszPhysicalView, System::UInt32 grfIDO, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsUIHierarchy ^ % ppHierOpen, [Runtime::InteropServices::Out] System::UInt32 % pitemidOpen, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsWindowFrame ^ % ppWindowFrame, [Runtime::InteropServices::Out] int % pfOpen);
public int IsSpecificDocumentViewOpen (Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy pHierCaller, uint itemidCaller, string pszMkDocument, ref Guid rguidEditorType, string pszPhysicalView, uint grfIDO, out Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy ppHierOpen, out uint pitemidOpen, out Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame ppWindowFrame, out int pfOpen);
abstract member IsSpecificDocumentViewOpen : Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy * uint32 * string * Guid * string * uint32 * IVsUIHierarchy * uint32 * IVsWindowFrame * int -> int
Public Function IsSpecificDocumentViewOpen (pHierCaller As IVsUIHierarchy, itemidCaller As UInteger, pszMkDocument As String, ByRef rguidEditorType As Guid, pszPhysicalView As String, grfIDO As UInteger, ByRef ppHierOpen As IVsUIHierarchy, ByRef pitemidOpen As UInteger, ByRef ppWindowFrame As IVsWindowFrame, ByRef pfOpen As Integer) As Integer

Parameters

pHierCaller
IVsUIHierarchy

[in] Hierarchy identifier of the caller passed as a pointer to the caller's IVsUIHierarchy implementation. This parameter is used by the environment's implementation of IsSpecificDocumentViewOpen(IVsUIHierarchy, UInt32, String, Guid, String, UInt32, IVsUIHierarchy, UInt32, IVsWindowFrame, Int32) if the caller specifies a value of IDO_ActivateIfOpen for the grfIDO parameter..

itemidCaller
UInt32

[in] UI hierarchy item identifier of the caller. Used with IDO_ActivateIfOpen. For more information see VSITEMID.

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.

rguidEditorType
Guid

[in] GUID of the editor factory. This value, in combination with pszPhysicalView is used to create the unique identifier of the specified document view.

pszPhysicalView
String

[in] Physical view string. This value, in combination with rguidEditorType, is used to create the unique identifier of the specified document view.

grfIDO
UInt32

[in] Flags that control what actions are performed on the open document. For a list of values, see __VSIDOFLAGS.

ppHierOpen
IVsUIHierarchy

[out] If pfOpen is true, then this parameter is a pointer to the IVsUIHierarchy implementation of the IVsHierarchy that owns the view. If pfOpen is false, then this parameter is null.

pitemidOpen
UInt32

[out] If pfOpen is true, then this parameter is a pointer to the UI hierarchy item identifier of the open document that is represented by the specified view. If pfOpen is false, then this parameter is null. For more information see VSITEMID.

ppWindowFrame
IVsWindowFrame

[out] If pfOpen is true, then this parameter is a pointer to the IVsWindowFrame containing the specified view.

pfOpen
Int32

[out, retval] true if the specified document view is open. false if the specified document view is not open.

Returns

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsUIShellOpenDocument::IsSpecificDocumentViewOpen(  
   [in] IVsUIHierarchy *pHierCaller,  
   [in] VSITEMID itemidCaller,  
   [in] LPCOLESTR pszMkDocument,  
   [in] REFGUID rguidEditorType,  
   [in] LPCOLESTR pszPhysicalView,  
   [in] VSIDOFLAGS grfIDO,  
   [out] IVsUIHierarchy **ppHierOpen,  
   [out] VSITEMID *pitemidOpen,  
   [out] IVsWindowFrame **ppWindowFrame,  
   [out, retval] BOOL *pfOpen  
);  

IsSpecificDocumentViewOpen takes a hierarchy/itemID pair as input that identifies the caller that wants to know whether the view is open. If the specified document view is open in the IDE, this method compares this hierarchy/itemID pair to the hierarchy/itemID pair that currently owns the open document (that is, the owning hierarchy) to determine if the hierarchies are different.

If a different hierarchy has the document view open and that hierarchy implements IVsSupportItemHandoff, then the IVsUIShellOpenDocument::IsSpecificDocumentViewOpen implementation calls the hierarchy's IVsSupportItemHandoff implementation and passes the hierarchy/itemID pair for the calling hierarchy (pHierCaller/itemidCaller).The document is then handed off to the calling hierarchy. If the hierarchy does not implement IVsSupportItemHandoff, then a message box is displayed with the following text, "The document is opened by another project.", The document view is not transferred to the calling hierarchy, and the existing document view is brought forward in the context of the owning hierarchy.

Applies to