Share via


IVsSupportItemHandoff.HandoffItem Method

Definition

Supports transferring an item from one project to another.

public:
 int HandoffItem(System::UInt32 itemid, Microsoft::VisualStudio::Shell::Interop::IVsProject3 ^ pProjDest, System::String ^ pszMkDocumentOld, System::String ^ pszMkDocumentNew, Microsoft::VisualStudio::Shell::Interop::IVsWindowFrame ^ punkWindowFrame);
public:
 int HandoffItem(unsigned int itemid, Microsoft::VisualStudio::Shell::Interop::IVsProject3 ^ pProjDest, Platform::String ^ pszMkDocumentOld, Platform::String ^ pszMkDocumentNew, Microsoft::VisualStudio::Shell::Interop::IVsWindowFrame ^ punkWindowFrame);
int HandoffItem(unsigned int itemid, Microsoft::VisualStudio::Shell::Interop::IVsProject3 const & pProjDest, std::wstring const & pszMkDocumentOld, std::wstring const & pszMkDocumentNew, Microsoft::VisualStudio::Shell::Interop::IVsWindowFrame const & punkWindowFrame);
public int HandoffItem (uint itemid, Microsoft.VisualStudio.Shell.Interop.IVsProject3 pProjDest, string pszMkDocumentOld, string pszMkDocumentNew, Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame punkWindowFrame);
abstract member HandoffItem : uint32 * Microsoft.VisualStudio.Shell.Interop.IVsProject3 * string * string * Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame -> int
Public Function HandoffItem (itemid As UInteger, pProjDest As IVsProject3, pszMkDocumentOld As String, pszMkDocumentNew As String, punkWindowFrame As IVsWindowFrame) As Integer

Parameters

itemid
UInt32

[in] Identifier of the item to be transferred.

pProjDest
IVsProject3

[in] Project to which the document will be transferred.

pszMkDocumentOld
String

[in] String form of the moniker identifier of the document in the project system for the document prior to transfer. The requesting project will pass this value to RenameDocument(String, String, IntPtr, UInt32) in the pszDocumentOld parameter.

pszMkDocumentNew
String

[in] String form of the moniker identifier of the document in the project system for the document following transfer. The requesting project will pass this value to RenameDocument(String, String, IntPtr, UInt32) as the pszDocumentNew parameter.

punkWindowFrame
IVsWindowFrame

[in] Pointer to the window frame containing the document view. This parameter is optional if the document is not open.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsSupportItemHandoff::HandoffItem(  
   [in] VSITEMID itemid,  
   [in] IVsProject3 *pProjDest,  
   [in] LPCOLESTR pszMkDocumentOld,  
   [in] LPCOLESTR pszMkDocumentNew,  
   [in] IVsWindowFrame *punkWindowFrame  
);  

In your IVsSupportItemHandoff.HandoffItem implementation, call TransferItem on the project requesting the item (pProjDest). In the method call, pass the values in pszMkDocumentOld, pszMkDocumentNew, and punkWindowFrame to the requesting project. The requesting project will then transfer the open document window for the item to itself and rename the document appropriately in the running document table (RDT) by calling RenameDocument.

Applies to