Opens the specified document in the specified logical view.
Namespace: Microsoft.VisualStudio.Shell
Assembly: Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
Syntax
'宣言
Public Shared Sub OpenDocument ( _
provider As IServiceProvider, _
fullPath As String, _
logicalView As Guid, _
<OutAttribute> ByRef hierarchy As IVsUIHierarchy, _
<OutAttribute> ByRef itemID As UInteger, _
<OutAttribute> ByRef windowFrame As IVsWindowFrame, _
<OutAttribute> ByRef view As IVsTextView _
)
'使用
Dim provider As IServiceProvider
Dim fullPath As String
Dim logicalView As Guid
Dim hierarchy As IVsUIHierarchy
Dim itemID As UInteger
Dim windowFrame As IVsWindowFrame
Dim view As IVsTextView
VsShellUtilities.OpenDocument(provider, fullPath, _
logicalView, hierarchy, itemID, windowFrame, _
view)
public static void OpenDocument(
IServiceProvider provider,
string fullPath,
Guid logicalView,
out IVsUIHierarchy hierarchy,
out uint itemID,
out IVsWindowFrame windowFrame,
out IVsTextView view
)
public:
static void OpenDocument(
IServiceProvider^ provider,
String^ fullPath,
Guid logicalView,
[OutAttribute] IVsUIHierarchy^% hierarchy,
[OutAttribute] unsigned int% itemID,
[OutAttribute] IVsWindowFrame^% windowFrame,
[OutAttribute] IVsTextView^% view
)
public static function OpenDocument(
provider : IServiceProvider,
fullPath : String,
logicalView : Guid,
hierarchy : IVsUIHierarchy,
itemID : uint,
windowFrame : IVsWindowFrame,
view : IVsTextView
)
Parameters
provider
Type: System.IServiceProvider
fullPath
Type: System.StringThe absolute path of the document.
logicalView
Type: System.GuidThe GUID of the logical view in which to open the document.
hierarchy
Type: Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy%[out] Returns the IVsUIHierarchy interface of the project that contains the document.
itemID
Type: System.UInt32%[out] The item ID of the document.
windowFrame
Type: Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame%[out] Returns the IVsWindowFrame interface of the window in which the document is open.
view
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextView%[out] Returns the IVsTextView interface of the primary view of the window.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.