IVsAsyncShellOpenDocument.OpenSpecificEditorAsync Method

Definition

Asynchronously opens a document using the specified editor.

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

Parameters

openSpecificEditorFlags
UInt32

Flags whose values are taken from the __VSOSPEFLAGS enumeration.

documentMoniker
String

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.

editorType
Guid

A Guid that identifies to editor be used to open the file.

physicalView
String

Name of the physical view or null.

If null, the environment calls MapLogicalView(Guid, String) on the editor factory to determine the physical view that corresponds to the logical view. In this case, null does not specify the primary view, but rather indicates that you do not know which view corresponds to the logical view.

logicalView
Guid

A Guid identifying the logical view. The default view is VSConstants.LOGVIEWID_Primary and every editor must support that view.

If the editor implements IVsMultiViewDocumentView on the document view object, then the value passed to ActivateLogicalView(Guid), which determines which view is activated when the editor window is shown.

By specifying the logical view Guid, you can request the specific view that matches the reason you are requesting the view. For example, specify VSConstants.LOGVIEWID_Debugging to get the view appropriate for debugging, or VSConstants.LOGVIEWID_TextView to get the view appropriate for the text editor (that is, a view that implements IVsCodeWindow).

ownerCaption
String

Initial caption defined by the document owner (that is, the project) for the document window. This is often of the form: "ProjectName – ItemName."

hierarchy
IVsUIHierarchy

A reference to the IVsUIHierarchy that owns the document.

itemId
UInt32

The UI hierarchy item identifier of the standard editor. For more information see VSConstants.VSITEMID.

shouldGetDocDataFromRdt
Boolean

If true, then the environment will use the doc data object obtained from the Running Document Table; otherwise, the service will open the document using the doc data passed in to docData.

docData
Object

A reference to the document data object of the item to open or null. This value passed into this parameter is ignored if shouldGetDocDataFromRdt is true.

serviceProvider
IServiceProvider

A reference to the IServiceProvider.

Returns

A task representing that the open operation has started. The result of the task is a reference to an IVsAsyncOpenDocumentResult, if the document was opened within the environment; otherwise, null.

Remarks

The task returned by this method does not indicate that the document's view and docdata have been loaded. See DocumentLoadTask for more details.

This method must be accessed on the main thread.

Applies to