IVsRunningDocumentTable.RenameDocument Method
Renames and/or changes the ownership of a document.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
'Declaration
Function RenameDocument ( _
pszMkDocumentOld As String, _
pszMkDocumentNew As String, _
pHier As IntPtr, _
itemidNew As UInteger _
) As Integer
int RenameDocument(
string pszMkDocumentOld,
string pszMkDocumentNew,
IntPtr pHier,
uint itemidNew
)
int RenameDocument(
[InAttribute] String^ pszMkDocumentOld,
[InAttribute] String^ pszMkDocumentNew,
[InAttribute] IntPtr pHier,
[InAttribute] unsigned int itemidNew
)
abstract RenameDocument :
pszMkDocumentOld:string *
pszMkDocumentNew:string *
pHier:IntPtr *
itemidNew:uint32 -> int
function RenameDocument(
pszMkDocumentOld : String,
pszMkDocumentNew : String,
pHier : IntPtr,
itemidNew : uint
) : int
Parameters
pszMkDocumentOld
Type: String[in] Path to the previous document.
pszMkDocumentNew
Type: String[in] Path to the current document.
pHier
Type: IntPtr[in] The IVsHierarchy interface that is to take ownership. Use HIERARCHY_DONTCHANGE if not changing ownership.
itemidNew
Type: UInt32[in] Item identifier of the current document if the hierarchy is to take ownership. This is a unique identifier or it can be one of the following values: VSITEMID_NIL, VSITEMID_ROOT, or VSITEMID_SELECTION. Use VSITEMID_NIL if not changing ownership.
Return Value
Type: Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
COM Signature
From vsshell.idl:
HRESULT IVsRunningDocumentTable::RenameDocument(
[in] LPCOLESTR pszMkDocumentOld,
[in] LPCOLESTR pszMkDocumentNew,
[in] IVsHierarchy *pHier,
[in] VSITEMID itemidNew
);
The project should call this method to transfer ownership of the document to its hierarchy and give the document a new itemid within the project.
.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.