Compartir a través de


IVsTrackProjectDocuments2.OnQueryRenameFiles Method

This method is called by a project to determine whether files can be renamed in the project.

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 in the project.

  • rgszMkOldNames
    Type: array<String[]

    [in] Array of paths for the old file names.

  • rgszMkNewNames
    Type: array<String[]

    [in] Array of paths for the 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 IVsTrackProjectDocuments2.idl

HRESULT IVsTrackProjectDocuments2::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[]
);

Call this method when you want to rename files in the project. This method must be called before the files are renamed in the project. The environment will return a flag indicating which files can be renamed. After you have received authorization to rename the files and you have renamed them, call OnAfterRenameFiles to confirm that the files have been renamed and to provide the environment with the new names.

.NET Framework Security

See Also

Reference

IVsTrackProjectDocuments2 Interface

Microsoft.VisualStudio.Shell.Interop Namespace