Condividi tramite


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.

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

See Also

Reference

IVsRunningDocumentTable Interface

Microsoft.VisualStudio.Shell.Interop Namespace