Opens an item in the project.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
int OpenItem( uint itemid, ref Guid rguidLogicalView, IntPtr punkDocDataExisting, out IVsWindowFrame ppWindowFrame )
- Type: System.UInt32
[in] Identifier of the item to open. Should be VSITEMID_ROOT or other valid item identifier. See the VSITEMID enumeration.
- Type: System.Guid
[in] Unique identifier of the logical view. If not GUID_NULL, indicates a specific type of view to create. For more information, see the LOGVIEWID.
- Type: System.IntPtr
[in] Pointer to the document data object of the item to open. If the caller of OpenItem had a pointer to the document data object, it would pass it in the punkDocDataExisting parameter. If the caller knew that the document data object was not open, it would pass null. If the caller did not know if the document data object was open or if it did not want to look it up in the running document table (RDT) to find out, then it could pass in DOCDATAEXISTING_UNKNOWN If this value is passed, then OpenStandardEditor will look up the value in the RDT by calling FindAndLockDocument (RDT_EditLock) to determine whether the file (document data object) is already open.
- Type: Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame
[out] Pointer to the IVsWindowFrame interface.
HRESULT IVsProject3::OpenItem( [in] VSITEMID itemid, [in] REFGUID rguidLogicalView, [in] IUnknown *punkDocDataExisting, [out] IVsWindowFrame **ppWindowFrame );
By implementing IVsProjectSpecificEditorMap2 Interface on your project object, you can do project-specific handling of files. That is, you can support either opening the file in a project-specific editor or allowing the global editor to open the item. Opening an item requires launching an editor using OpenStandardEditor or OpenSpecificEditor, depending on the handling you want to implement. For more information, see GetSpecificEditorProperty.
In your implementation of OpenItem, do not call Show on the window frame you return in ppWindowFrame.
Compare to ReopenItem method.
- 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.