IVsAsyncShellOpenDocument.OpenSpecificEditorAsync 方法

定义

使用指定的编辑器异步打开文档。

public Microsoft.VisualStudio.Shell.Interop.IVsTask OpenSpecificEditorAsync (uint openSpecificEditorFlags, string documentMoniker, Guid editorType, string? physicalView, Guid logicalView, string? ownerCaption, Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy? hierarchy, uint itemId, bool shouldGetDocDataFromRdt, object? docData, Microsoft.VisualStudio.OLE.Interop.IServiceProvider serviceProvider);
abstract member OpenSpecificEditorAsync : uint32 * string * Guid * string * Guid * string * Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy * uint32 * bool * obj * Microsoft.VisualStudio.OLE.Interop.IServiceProvider -> Microsoft.VisualStudio.Shell.Interop.IVsTask
Public Function OpenSpecificEditorAsync (openSpecificEditorFlags As UInteger, documentMoniker As String, editorType As Guid, physicalView As String, logicalView As Guid, ownerCaption As String, hierarchy As IVsUIHierarchy, itemId As UInteger, shouldGetDocDataFromRdt As Boolean, docData As Object, serviceProvider As IServiceProvider) As IVsTask

参数

openSpecificEditorFlags
UInt32

其值取自枚举的 __VSOSPEFLAGS 标志。

documentMoniker
String

项目系统中文档的唯一名字对象标识符的字符串形式,例如文件的完整路径。 在非文件情况下,此标识符通常采用 URL 的形式。

editorType
Guid

Guid标识为编辑器的 用于打开文件。

physicalView
String

物理视图的名称或 null

如果 null为 ,则环境在编辑器工厂上调用 MapLogicalView(Guid, String) 以确定与逻辑视图对应的物理视图。 在这种情况下, null 不指定主视图,而是指示你不知道哪个视图对应于逻辑视图。

logicalView
Guid

标识 Guid 逻辑视图的 。 默认视图为 VSConstants.LOGVIEWID_Primary ,每个编辑器都必须支持该视图。

如果编辑器在文档视图对象上实现 IVsMultiViewDocumentView ,则传递给 ActivateLogicalView(Guid)的值将确定显示编辑器窗口时激活哪个视图。

通过指定逻辑视图 Guid,可以请求与请求视图的原因匹配的特定视图。 例如,指定 VSConstants.LOGVIEWID_Debugging 以获取适合调试的视图,或 VSConstants.LOGVIEWID_TextView 获取适用于文本编辑器 (即实现 IVsCodeWindow) 的视图。

ownerCaption
String

文档所有者定义的初始描述文字 (即文档窗口的项目) 。 这通常采用以下形式:“ProjectName – ItemName”。

hierarchy
IVsUIHierarchy

IVsUIHierarchy 拥有文档的 的引用。

itemId
UInt32

标准编辑器的 UI 层次结构项标识符。 有关更多信息,请参见VSConstants.VSITEMID

shouldGetDocDataFromRdt
Boolean

如果 true为 ,则环境将使用从“正在运行的文档表”获取的文档数据对象;否则,服务将使用传递到 docData中的文档数据打开文档。

docData
Object

对要打开 null或 的项的文档数据对象的引用。 如果 shouldGetDocDataFromRdttrue为 ,则忽略传递到此参数的此值。

serviceProvider
IServiceProvider

IServiceProvider 的引用。

返回

表示打开操作已启动的任务。 如果文档在环境中打开,则任务的结果是对 IVsAsyncOpenDocumentResult的引用;否则为 null

注解

此方法返回的任务并不指示文档的视图和 docdata 已加载。 有关详细信息,请参阅 DocumentLoadTask

适用于