Partager via


IVsTrackProjectDocumentsEvents2.OnQueryRenameFiles Method

This method notifies the client when a project has requested to rename files.

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

Syntax

'Declaration
Function OnQueryRenameFiles ( _
    pProject As IVsProject, _
    cFiles As Integer, _
    rgszMkOldNames As String(), _
    rgszMkNewNames As String(), _
    rgFlags As VSQUERYRENAMEFILEFLAGS(), _
    <OutAttribute> pSummaryResult As VSQUERYRENAMEFILERESULTS(), _
    <OutAttribute> rgResults As VSQUERYRENAMEFILERESULTS() _
) As Integer
int OnQueryRenameFiles(
    IVsProject pProject,
    int cFiles,
    string[] rgszMkOldNames,
    string[] rgszMkNewNames,
    VSQUERYRENAMEFILEFLAGS[] rgFlags,
    VSQUERYRENAMEFILERESULTS[] pSummaryResult,
    VSQUERYRENAMEFILERESULTS[] rgResults
)
int OnQueryRenameFiles(
    [InAttribute] IVsProject^ pProject, 
    [InAttribute] int cFiles, 
    [InAttribute] array<String^>^ rgszMkOldNames, 
    [InAttribute] array<String^>^ rgszMkNewNames, 
    [InAttribute] array<VSQUERYRENAMEFILEFLAGS>^ rgFlags, 
    [OutAttribute] array<VSQUERYRENAMEFILERESULTS>^ pSummaryResult, 
    [OutAttribute] array<VSQUERYRENAMEFILERESULTS>^ rgResults
)
abstract OnQueryRenameFiles : 
        pProject:IVsProject * 
        cFiles:int * 
        rgszMkOldNames:string[] * 
        rgszMkNewNames:string[] * 
        rgFlags:VSQUERYRENAMEFILEFLAGS[] * 
        pSummaryResult:VSQUERYRENAMEFILERESULTS[] byref * 
        rgResults:VSQUERYRENAMEFILERESULTS[] byref -> int
function OnQueryRenameFiles(
    pProject : IVsProject, 
    cFiles : int, 
    rgszMkOldNames : String[], 
    rgszMkNewNames : String[], 
    rgFlags : VSQUERYRENAMEFILEFLAGS[], 
    pSummaryResult : VSQUERYRENAMEFILERESULTS[], 
    rgResults : VSQUERYRENAMEFILERESULTS[]
) : int

Parameters

  • cFiles
    Type: Int32

    [in] Number of files to rename.

  • rgszMkOldNames
    Type: array<String[]

    [in] Array of old file names.

  • rgszMkNewNames
    Type: array<String[]

    [in] Array of new file names.

Return Value

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

Remarks

COM Signature

From IVsTrackProjectDocumentsEvents2.idl

HRESULT IVsTrackProjectDocumentsEvents2::OnQueryRenameFiles(
   [in] IVsProject *pProject,
   [in] int cFiles, [in, size_is(cFiles)] const LPCOLESTR rgszMkOldNames[],
   [in, size_is(cFiles)] const LPCOLESTR rgszMkNewNames[],
   [in, size_is(cFiles)] const VSQUERYRENAMEFILEFLAGS rgflags[],
   [out] VSQUERYRENAMEFILERESULTS *pSummaryResult,
   [out, size_is(cFiles)] VSQUERYRENAMEFILERESULTS rgResults[]
);

Use IVsTrackProjectDocumentsEvents2.OnQueryRenameFiles to indicate whether specified files can be renamed in the project. Only deny a query if allowing the operation would compromise your stable state. For example, source control denies rename queries if the new name conflicts with an existing file already under source control.

.NET Framework Security

See Also

Reference

IVsTrackProjectDocumentsEvents2 Interface

Microsoft.VisualStudio.Shell.Interop Namespace