IVsAsyncShellOpenDocument.OpenDocumentViaProjectWithSpecificAsync Method

Definition

Finds a specified project to open this document.

public Microsoft.VisualStudio.Shell.Interop.IVsTask OpenDocumentViaProjectWithSpecificAsync (string documentMoniker, uint specificEditorFlags, Guid editorType, string? physicalView, Guid logicalView);
abstract member OpenDocumentViaProjectWithSpecificAsync : string * uint32 * Guid * string * Guid -> Microsoft.VisualStudio.Shell.Interop.IVsTask
Public Function OpenDocumentViaProjectWithSpecificAsync (documentMoniker As String, specificEditorFlags As UInteger, editorType As Guid, physicalView As String, logicalView As Guid) As IVsTask

Parameters

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.

specificEditorFlags
UInt32

Flags whose values are taken from the __VSSPECIFICEDITORFLAGS enumeration.

editorType
Guid

Unique identifier of the editor type.

physicalView
String

Unique identifier of the physical 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).

Returns

A task representing the open operation. The result of the task is an IVsAsyncOpenDocumentResult object.

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 is used by VSPackages that are not projects that need to open a document in a specific editor, but do not care which project opens the file. To call this method from your VSPackage, you need to know exactly which editor factory you want and exactly which window you want the editor factory to create (that is, the physical view). The logical view specified in the logicalView parameter further allows you to specify which tab should be displayed by the editor if the editor implements IVsMultiViewDocumentView.

This method calls OpenItem(UInt32, Guid, IntPtr, IVsWindowFrame). If no project can service the file and the Miscellaneous Files project is not already present, the environment then creates the Miscellaneous Files project and tries again.

This method must be accessed on the main thread.

Applies to