IVsObjectList::DoRename Method (UInt32, String^, UInt32)
Asks the given list item to do the rename operation.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Parameters
- index
-
Type:
System::UInt32
[in] Specifies the index of the list item of interest.
- pszNewName
-
Type:
System::String^
[in] Pointer to a null terminated string containing the new name.
- grfFlags
-
Type:
System::UInt32
[in] Flag indicating that Index is part of a multi-select. Values are taken from the _VSOBJOPFLAGS enumeration.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From vsshell.idl:
HRESULT IVsObjectList::DoRename( [in] ULONG Index, [in] LPCOLESTR pszNewName, [in] VSOBJOPFLAGS grfFlags );
The environment calls DoRename when the user commits the rename operation. This method will be called only after CanRename has been called with the pszNewName so that you've had a chance to validate the name. If DoRename succeeds, return S_OK, otherwise return an error in hr and set the rich error info to indicate the problem that was encountered.
If multiple items are to be renamed, the environment will set grfFlags to indicate that multiple DoRename calls are being made. The environment also used the grfFlags parameter to indicate the first and last item to be renamed. You can use this, for instance, to create a single undo action for the multiple data items.