共用方式為


IVsHierarchyRefactorNotify.OnBeforeGlobalSymbolRenamed Method

Called when a symbol is about to be renamed.

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

Syntax

'宣告
Function OnBeforeGlobalSymbolRenamed ( _
    cItemsAffected As UInteger, _
    rgItemsAffected As UInteger(), _
    cRQNames As UInteger, _
    rglpszRQName As String(), _
    lpszNewName As String, _
    promptContinueOnFail As Integer _
) As Integer
'用途
Dim instance As IVsHierarchyRefactorNotify
Dim cItemsAffected As UInteger
Dim rgItemsAffected As UInteger()
Dim cRQNames As UInteger
Dim rglpszRQName As String()
Dim lpszNewName As String
Dim promptContinueOnFail As Integer
Dim returnValue As Integer

returnValue = instance.OnBeforeGlobalSymbolRenamed(cItemsAffected, _
    rgItemsAffected, cRQNames, rglpszRQName, _
    lpszNewName, promptContinueOnFail)
int OnBeforeGlobalSymbolRenamed(
    uint cItemsAffected,
    uint[] rgItemsAffected,
    uint cRQNames,
    string[] rglpszRQName,
    string lpszNewName,
    int promptContinueOnFail
)
int OnBeforeGlobalSymbolRenamed(
    [InAttribute] unsigned int cItemsAffected, 
    [InAttribute] array<unsigned int>^ rgItemsAffected, 
    [InAttribute] unsigned int cRQNames, 
    [InAttribute] array<String^>^ rglpszRQName, 
    [InAttribute] String^ lpszNewName, 
    [InAttribute] int promptContinueOnFail
)
abstract OnBeforeGlobalSymbolRenamed : 
        cItemsAffected:uint32 * 
        rgItemsAffected:uint32[] * 
        cRQNames:uint32 * 
        rglpszRQName:string[] * 
        lpszNewName:string * 
        promptContinueOnFail:int -> int 
function OnBeforeGlobalSymbolRenamed(
    cItemsAffected : uint, 
    rgItemsAffected : uint[], 
    cRQNames : uint, 
    rglpszRQName : String[], 
    lpszNewName : String, 
    promptContinueOnFail : int
) : int

Parameters

  • cItemsAffected
    Type: System.UInt32
    The number of files affected by the rename.
  • rgItemsAffected
    Type: array<System.UInt32[]
    An array of VSITEMIDs that identifies the files that will be affected.
  • cRQNames
    Type: System.UInt32
    The number of renamed symbols. The number can be greater than one, if an overloaded symbol is renamed.
  • rglpszRQName
    Type: array<System.String[]
    The name of the symbol before rename.
  • lpszNewName
    Type: System.String
    The name of the symbol after the rename.
  • promptContinueOnFail
    Type: System.Int32
    true to prompt the user to continue the rename operation if one or more IVsRefactorNotify implementers fails; otherwise, false.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

To stop the rename operation, the HRESULT must contain one of the following error codes:

E_ABORT

OLE_E_PROMPTSAVECANCELLED

OLECMDERR_E_CANCELED

HR_E_CSHARP_USER_CANCEL

A symbol with the same name may have more than one occurrence, if the language allows overloading operations, such as method overloading:

void SomeMethod() {}
void SomeMethod(int i) {}

COM Signature

From vsshell80.idl:

HRESULT OnBeforeGlobalSymbolRenamed(
    [in] ULONG cItemsAffected,                               
    [in, size_is(cItemsAffected)] VSITEMID rgItemsAffected[],
    [in] ULONG cRQNames,                                     
    [in, size_is(cRQNames)] LPCOLESTR rglpszRQName[],        
    [in] LPCOLESTR lpszNewName,                              
    [in] BOOL promptContinueOnFail);                         

.NET Framework Security

See Also

Reference

IVsHierarchyRefactorNotify Interface

IVsHierarchyRefactorNotify Members

Microsoft.VisualStudio.Shell.Interop Namespace