共用方式為


VsShellUtilities.IsDocumentOpen Method

Definition

Determines whether the specified document is open.

public:
 static bool IsDocumentOpen(IServiceProvider ^ provider, System::String ^ fullPath, Guid logicalView, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsUIHierarchy ^ % hierarchy, [Runtime::InteropServices::Out] System::UInt32 % itemID, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Shell::Interop::IVsWindowFrame ^ % windowFrame);
public static bool IsDocumentOpen (IServiceProvider provider, string fullPath, Guid logicalView, out Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy hierarchy, out uint itemID, out Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame windowFrame);
static member IsDocumentOpen : IServiceProvider * string * Guid * IVsUIHierarchy * uint32 * IVsWindowFrame -> bool
Public Shared Function IsDocumentOpen (provider As IServiceProvider, fullPath As String, logicalView As Guid, ByRef hierarchy As IVsUIHierarchy, ByRef itemID As UInteger, ByRef windowFrame As IVsWindowFrame) As Boolean
Public Function IsDocumentOpen (provider As IServiceProvider, fullPath As String, logicalView As Guid, ByRef hierarchy As IVsUIHierarchy, ByRef itemID As UInteger, ByRef windowFrame As IVsWindowFrame) As Boolean

Parameters

provider
IServiceProvider

The service provider.

fullPath
String

Full path to the document

logicalView
Guid

GUID identifying the logical view. If logicalView is set to Guid.Empty, it will return true if any view is open.

hierarchy
IVsUIHierarchy

Reference to the IVsUIHierarchy interface of the project that contains the Open document

itemID
UInt32

Reference to the hierarchy item identifier of the document in the project

windowFrame
IVsWindowFrame

A reference to the window frame that is mapped to the document

Returns

true if the document is open with the given logical view

Applies to