IVsProject3.TransferItem Method
Transfers an item from one project to another. The project that presently owns the item to be transferred calls this method on the project intending to receive the transferred item.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
'Declaration
Function TransferItem ( _
pszMkDocumentOld As String, _
pszMkDocumentNew As String, _
punkWindowFrame As IVsWindowFrame _
) As Integer
'Usage
Dim instance As IVsProject3
Dim pszMkDocumentOld As String
Dim pszMkDocumentNew As String
Dim punkWindowFrame As IVsWindowFrame
Dim returnValue As Integer
returnValue = instance.TransferItem(pszMkDocumentOld, _
pszMkDocumentNew, punkWindowFrame)
int TransferItem(
string pszMkDocumentOld,
string pszMkDocumentNew,
IVsWindowFrame punkWindowFrame
)
int TransferItem(
[InAttribute] String^ pszMkDocumentOld,
[InAttribute] String^ pszMkDocumentNew,
[InAttribute] IVsWindowFrame^ punkWindowFrame
)
abstract TransferItem :
pszMkDocumentOld:string *
pszMkDocumentNew:string *
punkWindowFrame:IVsWindowFrame -> int
function TransferItem(
pszMkDocumentOld : String,
pszMkDocumentNew : String,
punkWindowFrame : IVsWindowFrame
) : int
Parameters
- pszMkDocumentOld
Type: System.String
[in] Path to the old document. Passed as pszDocumentOld to RenameDocument.
- pszMkDocumentNew
Type: System.String
[in] Path to the new document. Passed as pszDocumentNew to RenameDocument.
- punkWindowFrame
Type: Microsoft.VisualStudio.Shell.Interop.IVsWindowFrame
[in] Optional. 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 IVsProject3::TransferItem(
[in] LPCOLESTR pszMkDocumentOld,
[in] LPCOLESTR pszMkDocumentNew,
[in] IVsWindowFrame *punkWindowFrame
);
This method is used to transfer ownership of a running document to the project. The project should call RenameDocument to transfer ownership of the document to its hierarchy and give the document a new itemid within the project.
This method is called when an open file is being transferred to your project. The sequence is for the environment to call AddItemWithSpecific and then use TransferItem to transfer the open document to your project.
Both projects must be open to transfer an item from one to the other. The implementer of the transfer must call RenameDocument to rename the item.
.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.