IVsSupportItemHandoff.HandoffItem Method

Supports transferring an item from one project to another.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'宣言
Function HandoffItem ( _
    itemid As UInteger, _
    pProjDest As IVsProject3, _
    pszMkDocumentOld As String, _
    pszMkDocumentNew As String, _
    punkWindowFrame As IVsWindowFrame _
) As Integer
'使用
Dim instance As IVsSupportItemHandoff
Dim itemid As UInteger
Dim pProjDest As IVsProject3
Dim pszMkDocumentOld As String
Dim pszMkDocumentNew As String
Dim punkWindowFrame As IVsWindowFrame
Dim returnValue As Integer

returnValue = instance.HandoffItem(itemid, _
    pProjDest, pszMkDocumentOld, pszMkDocumentNew, _
    punkWindowFrame)
int HandoffItem(
    uint itemid,
    IVsProject3 pProjDest,
    string pszMkDocumentOld,
    string pszMkDocumentNew,
    IVsWindowFrame punkWindowFrame
)
int HandoffItem(
    [InAttribute] unsigned int itemid, 
    [InAttribute] IVsProject3^ pProjDest, 
    [InAttribute] String^ pszMkDocumentOld, 
    [InAttribute] String^ pszMkDocumentNew, 
    [InAttribute] IVsWindowFrame^ punkWindowFrame
)
function HandoffItem(
    itemid : uint, 
    pProjDest : IVsProject3, 
    pszMkDocumentOld : String, 
    pszMkDocumentNew : String, 
    punkWindowFrame : IVsWindowFrame
) : int

Parameters

  • itemid
    Type: System.UInt32

    [in] Identifier of the item to be transferred.

  • pszMkDocumentOld
    Type: System.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 in the pszDocumentOld parameter.

  • pszMkDocumentNew
    Type: System.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 as the pszDocumentNew parameter.

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 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.

Permissions

See Also

Reference

IVsSupportItemHandoff Interface

IVsSupportItemHandoff Members

Microsoft.VisualStudio.Shell.Interop Namespace