Compartilhar via


IVsTrackProjectDocuments2.OnQueryRenameFiles Method

Definition

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

public:
 int OnQueryRenameFiles(Microsoft::VisualStudio::Shell::Interop::IVsProject ^ pProject, int cFiles, cli::array <System::String ^> ^ rgszMkOldNames, cli::array <System::String ^> ^ rgszMkNewNames, cli::array <Microsoft::VisualStudio::Shell::Interop::VSQUERYRENAMEFILEFLAGS> ^ rgFlags, cli::array <Microsoft::VisualStudio::Shell::Interop::VSQUERYRENAMEFILERESULTS> ^ pSummaryResult, cli::array <Microsoft::VisualStudio::Shell::Interop::VSQUERYRENAMEFILERESULTS> ^ rgResults);
public:
 int OnQueryRenameFiles(Microsoft::VisualStudio::Shell::Interop::IVsProject ^ pProject, int cFiles, Platform::Array <Platform::String ^> ^ rgszMkOldNames, Platform::Array <Platform::String ^> ^ rgszMkNewNames, Platform::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYRENAMEFILEFLAGS> ^ rgFlags, Platform::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYRENAMEFILERESULTS> ^ pSummaryResult, Platform::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYRENAMEFILERESULTS> ^ rgResults);
int OnQueryRenameFiles(Microsoft::VisualStudio::Shell::Interop::IVsProject const & pProject, int cFiles, std::Array <std::wstring const &> const & rgszMkOldNames, std::Array <std::wstring const &> const & rgszMkNewNames, std::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYRENAMEFILEFLAGS> const & rgFlags, std::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYRENAMEFILERESULTS> const & pSummaryResult, std::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYRENAMEFILERESULTS> const & rgResults);
public int OnQueryRenameFiles (Microsoft.VisualStudio.Shell.Interop.IVsProject pProject, int cFiles, string[] rgszMkOldNames, string[] rgszMkNewNames, Microsoft.VisualStudio.Shell.Interop.VSQUERYRENAMEFILEFLAGS[] rgFlags, Microsoft.VisualStudio.Shell.Interop.VSQUERYRENAMEFILERESULTS[] pSummaryResult, Microsoft.VisualStudio.Shell.Interop.VSQUERYRENAMEFILERESULTS[] rgResults);
abstract member OnQueryRenameFiles : Microsoft.VisualStudio.Shell.Interop.IVsProject * int * string[] * string[] * Microsoft.VisualStudio.Shell.Interop.VSQUERYRENAMEFILEFLAGS[] * Microsoft.VisualStudio.Shell.Interop.VSQUERYRENAMEFILERESULTS[] * Microsoft.VisualStudio.Shell.Interop.VSQUERYRENAMEFILERESULTS[] -> int
Public Function OnQueryRenameFiles (pProject As IVsProject, cFiles As Integer, rgszMkOldNames As String(), rgszMkNewNames As String(), rgFlags As VSQUERYRENAMEFILEFLAGS(), pSummaryResult As VSQUERYRENAMEFILERESULTS(), rgResults As VSQUERYRENAMEFILERESULTS()) As Integer

Parameters

pProject
IVsProject

[in] Project in which the files will be renamed.

cFiles
Int32

[in] Number of files to rename in the project.

rgszMkOldNames
String[]

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

rgszMkNewNames
String[]

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

rgFlags
VSQUERYRENAMEFILEFLAGS[]

[in] Array of flags. For a list of rgFlags values, see VSQUERYRENAMEFILEFLAGS.

pSummaryResult
VSQUERYRENAMEFILERESULTS[]

[out] Summary result object. This object is a summation of the yes and no results for the array of files passed in rgszMkOldNames. If the result for a single file is no, then pSummaryResult is equal to VSQUERYRENAMEFILERESULTS_RenameNotOK; if the results for all files are yes, then pSummaryResult is equal to VSQUERYRENAMEFILERESULTS_RenameOK. For a list of pSummaryResult values, see VSQUERYRENAMEFILERESULTS.

rgResults
VSQUERYRENAMEFILERESULTS[]

[out] Array of results. For a list of rgResults values, see VSQUERYRENAMEFILERESULTS. Note   If you pass in null for this parameter, then only the summary result will be returned (pSummaryResult).

Returns

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.

Applies to