This documentation is archived and is not being maintained.

IVsObjectList2.DoRename Method

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 (
	[InAttribute] uint index,
	[InAttribute] string pszNewName,
	[InAttribute] uint grfFlags
)
int DoRename (
	/** @attribute InAttribute() */ UInt32 index, 
	/** @attribute InAttribute() */ String pszNewName, 
	/** @attribute InAttribute() */ UInt32 grfFlags
)
function DoRename (
	index : uint, 
	pszNewName : String, 
	grfFlags : uint
) : int

Parameters

index

[in] Specifies the index of the list item of interest.

pszNewName

[in] Pointer to a null-terminated string containing the new name.

grfFlags

[in] Flag indicating that Index is part of a multi-select. Values are taken from the _VSOBJOPFLAGS enumeration.

Return Value

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

COM Signature

From vsshell80.idl:

HRESULT IVsObjectList2::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 sets 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.

Show: