IVsUIShellOpenDocument.OpenDocumentViaProjectWithSpecific Method
Finds a specified project to open this document.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
'Declaration
Function OpenDocumentViaProjectWithSpecific ( _
pszMkDocument As String, _
grfEditorFlags As UInteger, _
ByRef rguidEditorType As Guid, _
pszPhysicalView As String, _
ByRef rguidLogicalView As Guid, _
<OutAttribute> ByRef ppSP As IServiceProvider, _
<OutAttribute> ByRef ppHier As IVsUIHierarchy, _
<OutAttribute> ByRef pitemid As UInteger, _
<OutAttribute> ByRef ppWindowFrame As IVsWindowFrame _
) As Integer
int OpenDocumentViaProjectWithSpecific(
string pszMkDocument,
uint grfEditorFlags,
ref Guid rguidEditorType,
string pszPhysicalView,
ref Guid rguidLogicalView,
out IServiceProvider ppSP,
out IVsUIHierarchy ppHier,
out uint pitemid,
out IVsWindowFrame ppWindowFrame
)
int OpenDocumentViaProjectWithSpecific(
[InAttribute] String^ pszMkDocument,
[InAttribute] unsigned int grfEditorFlags,
[InAttribute] Guid% rguidEditorType,
[InAttribute] String^ pszPhysicalView,
[InAttribute] Guid% rguidLogicalView,
[OutAttribute] IServiceProvider^% ppSP,
[OutAttribute] IVsUIHierarchy^% ppHier,
[OutAttribute] unsigned int% pitemid,
[OutAttribute] IVsWindowFrame^% ppWindowFrame
)
abstract OpenDocumentViaProjectWithSpecific :
pszMkDocument:string *
grfEditorFlags:uint32 *
rguidEditorType:Guid byref *
pszPhysicalView:string *
rguidLogicalView:Guid byref *
ppSP:IServiceProvider byref *
ppHier:IVsUIHierarchy byref *
pitemid:uint32 byref *
ppWindowFrame:IVsWindowFrame byref -> int
function OpenDocumentViaProjectWithSpecific(
pszMkDocument : String,
grfEditorFlags : uint,
rguidEditorType : Guid,
pszPhysicalView : String,
rguidLogicalView : Guid,
ppSP : IServiceProvider,
ppHier : IVsUIHierarchy,
pitemid : uint,
ppWindowFrame : IVsWindowFrame
) : int
Parameters
pszMkDocument
Type: String[in] 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.
grfEditorFlags
Type: UInt32[in] Flags whose values are taken from the __VSSPECIFICEDITORFLAGS enumeration.
rguidEditorType
Type: Guid%[in] Unique identifier of the editor type.
pszPhysicalView
Type: String[in] Unique identifier of the physical view.
rguidLogicalView
Type: Guid%[in] Unique identifier of the logical view. If the editor implements IVsMultiViewDocumentView on the document view object, then the value passed into the rguidLogicalView parameter determines which view is activated when the editor window is shown, when the editor is instantiated. By specifying the logical view GUID, you can request the specific view that matches the reason you are requesting the view. For example, specify LOGVIEWID_Debugging to get the view appropriate for debugging, or LOGVIEWID_TextView to get the view appropriate for the text editor (that is, a view that implements IVsCodeWindow).
ppSP
Type: Microsoft.VisualStudio.OLE.Interop.IServiceProvider%[out] Pointer to the IServiceProvider interface.
ppHier
Type: Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy%[out] Pointer to the IVsUIHierarchy interface of the project that can open the document.
pitemid
Type: UInt32%[out] Pointer to the hierarchy item identifier of the document in the project. For more information see VSITEMID.
ppWindowFrame
Type: Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame%[out, retval] Pointer to the window frame that contains the editor. For more information, see IVsWindowFrame.
Return Value
Type: Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
COM Signature
From vsshell.idl:
HRESULT IVsUIShellOpenDocument::OpenDocumentViaProjectWithSpecific(
[in] LPCOLESTR pszMkDocument,
[in] VSSPECIFICEDITORFLAGS grfEditorFlags,
[in] REFGUID rguidEditorType,
[in] LPCOLESTR pszPhysicalView,
[in] REFGUID rguidLogicalView,
[out] IServiceProvider **ppSP,
[out] IVsUIHierarchy **ppHier,
[out] VSITEMID *pitemid,
[out, retval] IVsWindowFrame **ppWindowFrame
);
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 rguidLogicalView parameter further allows you to specify which tab should be displayed by the editor if the editor implements IVsMultiViewDocumentView.
This method calls OpenItem. 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.
.NET Framework Security
- 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.