IVsUIShellOpenDocument.OpenSpecificEditor Method
Opens a specified editor.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
'Déclaration
Function OpenSpecificEditor ( _
grfOpenSpecific As UInteger, _
pszMkDocument As String, _
ByRef rguidEditorType As Guid, _
pszPhysicalView As String, _
ByRef rguidLogicalView As Guid, _
pszOwnerCaption As String, _
pHier As IVsUIHierarchy, _
itemid As UInteger, _
punkDocDataExisting As IntPtr, _
pSPHierContext As IServiceProvider, _
<OutAttribute> ByRef ppWindowFrame As IVsWindowFrame _
) As Integer
'Utilisation
Dim instance As IVsUIShellOpenDocument
Dim grfOpenSpecific As UInteger
Dim pszMkDocument As String
Dim rguidEditorType As Guid
Dim pszPhysicalView As String
Dim rguidLogicalView As Guid
Dim pszOwnerCaption As String
Dim pHier As IVsUIHierarchy
Dim itemid As UInteger
Dim punkDocDataExisting As IntPtr
Dim pSPHierContext As IServiceProvider
Dim ppWindowFrame As IVsWindowFrame
Dim returnValue As Integer
returnValue = instance.OpenSpecificEditor(grfOpenSpecific, _
pszMkDocument, rguidEditorType, _
pszPhysicalView, rguidLogicalView, _
pszOwnerCaption, pHier, itemid, punkDocDataExisting, _
pSPHierContext, ppWindowFrame)
int OpenSpecificEditor(
uint grfOpenSpecific,
string pszMkDocument,
ref Guid rguidEditorType,
string pszPhysicalView,
ref Guid rguidLogicalView,
string pszOwnerCaption,
IVsUIHierarchy pHier,
uint itemid,
IntPtr punkDocDataExisting,
IServiceProvider pSPHierContext,
out IVsWindowFrame ppWindowFrame
)
int OpenSpecificEditor(
[InAttribute] unsigned int grfOpenSpecific,
[InAttribute] String^ pszMkDocument,
[InAttribute] Guid% rguidEditorType,
[InAttribute] String^ pszPhysicalView,
[InAttribute] Guid% rguidLogicalView,
[InAttribute] String^ pszOwnerCaption,
[InAttribute] IVsUIHierarchy^ pHier,
[InAttribute] unsigned int itemid,
[InAttribute] IntPtr punkDocDataExisting,
[InAttribute] IServiceProvider^ pSPHierContext,
[OutAttribute] IVsWindowFrame^% ppWindowFrame
)
function OpenSpecificEditor(
grfOpenSpecific : uint,
pszMkDocument : String,
rguidEditorType : Guid,
pszPhysicalView : String,
rguidLogicalView : Guid,
pszOwnerCaption : String,
pHier : IVsUIHierarchy,
itemid : uint,
punkDocDataExisting : IntPtr,
pSPHierContext : IServiceProvider,
ppWindowFrame : IVsWindowFrame
) : int
Parameters
grfOpenSpecific
Type: System.UInt32[in] Values taken from the __VSOSPEFLAGS enumeration.
pszMkDocument
Type: System.String[in] String form of the unique moniker identifier of the document in the project system. If the document is a file, you can simply specify the file extension for this parameter rather than the full path to the file (for example, .bmp or txt). In non-file cases, this identifier is often in the form of a URL.
rguidEditorType
Type: System.Guid%[in] Unique identifier of the editor type.
pszPhysicalView
Type: System.String[in] Name of the physical view. If nulla null reference (Nothing in Visual Basic), the environment calls MapLogicalView on the editor factory to determine the physical view that corresponds to the logical view. In this case, nulla null reference (Nothing in Visual Basic) does not specify the primary view, but rather indicates that you do not know which view corresponds to the logical view.
rguidLogicalView
Type: System.Guid%[in] GUID identifying the logical view. For a list of logical view GUIDS, see Interaction Between Logical Views and Physical Views. If you implement IVsMultiViewDocumentView on your 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, the caller of InitializeEditorInstance can request the specific view that matches the reason the caller is requesting the view. For example, the caller would specify LOGVIEWID_Debugging to get the view appropriate for debugging view, or LOGVIEWID_TextView to get the view appropriate for the text editor (that is, a view that implements IVsCodeWindow).
pszOwnerCaption
Type: System.String[in] Initial caption defined by the document owner (that is, the project) for the document window. This is often of the form: "ProjectName – ItemName."
pHier
Type: Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy[in] Pointer to the IVsUIHierarchy interface.
itemid
Type: System.UInt32[in] UI hierarchy item identifier for the specified editor. For more information see VSITEMID.
punkDocDataExisting
Type: System.IntPtr[in] Pointer to the IUnknown interface.
pSPHierContext
Type: Microsoft.VisualStudio.OLE.Interop.IServiceProvider[in] Pointer to the IServiceProvide interface.
ppWindowFrame
Type: Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame%[out, retval] Pointer to the IVsWindowFrame interface.
Return Value
Type: System.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::OpenSpecificEditor(
[in] VSOSPEFLAGS grfOpenSpecific,
[in] LPCOLESTR pszMkDocument,
[in] REFGUID rguidEditorType,
[in] LPCOLESTR pszPhysicalView,
[in] REFGUID rguidLogicalView,
[in] LPCOLESTR pszOwnerCaption,
[in] IVsUIHierarchy *pHier,
[in] VSITEMID itemid,
[in] IUnknown *punkDocDataExisting,
[in] IServiceProvider *pSPHierContext,
[out, retval] IVsWindowFrame **ppWindowFrame
);
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.
See Also
Reference
IVsUIShellOpenDocument Interface