IVsSimpleObjectList2::DoRename Method (UInt32, String^, UInt32)

 

Asks the given list item to do the rename operation.

Namespace:   Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)

int DoRename(
	unsigned int index,
	String^ pszNewName,
	unsigned int grfFlags
)

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

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

From vsshell80.idl:

HRESULT IVsSimpleObjectList2::DoRename(
   [in] ULONG        Index, 
   [in] LPCOLESTR    pszNewName, 
   [in] VSOBJOPFLAGS grfFlags
);

The environment calls DoRename when the user commits the rename operation. This method is called only after CanRename has been called with the pszNewName so that you have had a chance to validate the name. If DoRename succeeds, return S_OK, otherwise return an error 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.

Return to top
Show: