Freigeben über


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
'Usage
Dim instance As IVsRunningDocumentTable
Dim pszMkDocumentOld As String
Dim pszMkDocumentNew As String
Dim pHier As IntPtr
Dim itemidNew As UInteger
Dim returnValue As Integer

returnValue = instance.RenameDocument(pszMkDocumentOld, _
    pszMkDocumentNew, pHier, itemidNew)
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: System.String
    [in] Path to the previous document.
  • pszMkDocumentNew
    Type: System.String
    [in] Path to the current document.
  • pHier
    Type: System.IntPtr
    [in] The IVsHierarchy interface that is to take ownership. Use HIERARCHY_DONTCHANGE if not changing ownership.

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

See Also

Reference

IVsRunningDocumentTable Interface

IVsRunningDocumentTable Members

Microsoft.VisualStudio.Shell.Interop Namespace