IVsObjectList2.CanRename(UInt32, String, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a flag indicating if the given list item can be renamed.
public:
int CanRename(System::UInt32 index, System::String ^ pszNewName, [Runtime::InteropServices::Out] int % pfOK);
int CanRename(unsigned int index, std::wstring const & pszNewName, [Runtime::InteropServices::Out] int & pfOK);
public int CanRename (uint index, string pszNewName, out int pfOK);
abstract member CanRename : uint32 * string * int -> int
Public Function CanRename (index As UInteger, pszNewName As String, ByRef pfOK As Integer) As Integer
Parameters
- index
- UInt32
[in] Specifies the index of the list item of interest.
- pszNewName
- String
[in] Pointer to a null-terminated string containing the new name.
- pfOK
- Int32
[out] Pointer to a flag indicating whether an item can be renamed.
Returns
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
COM Signature
From vsshell80.idl:
[C++]
HRESULT IVsObjectList2::CanRename(
[in] ULONG Index,
[in] LPCOLESTR pszNewName,
[out] BOOL *pfOK
);
Return pfOK
to indicate whether the item Index can be renamed. If the passed in pszNewName
is null
, you simply answer the general question of whether or not that item supports rename (return true
or false
). If pszNewName
is non-null, do validation of the new name and return true
if successful rename with that new name is possible or an error in hr (along with false
) if the name is somehow invalid and set the rich error info to indicate to the user what was wrong.