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

C#
int RenameDocument(
    string pszMkDocumentOld,
    string pszMkDocumentNew,
    IntPtr pHier,
    uint itemidNew
)

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:

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