Freigeben über


IVsTrackProjectDocuments2.OnQueryRenameDirectories Method

Definition

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

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

Parameters

pProject
IVsProject

[in] Project containing the directories to rename.

cDirs
Int32

[in] Number of directories to be renamed.

rgszMkOldNames
String[]

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

rgszMkNewNames
String[]

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

rgFlags
VSQUERYRENAMEDIRECTORYFLAGS[]

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

pSummaryResult
VSQUERYRENAMEDIRECTORYRESULTS[]

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

rgResults
VSQUERYRENAMEDIRECTORYRESULTS[]

[out] Array of results. For a list of rgResults values, see VSQUERYRENAMEDIRECTORYRESULTS. 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::OnQueryRenameDirectories(  
   [in] IVsProject *pProject,  
   [in] int cDirs,  
   [in, size_is(cDirs)] const LPCOLESTR rgszMkOldNames[],  
   [in, size_is(cDirs)] const LPCOLESTR rgszMkNewNames[],  
   [in, size_is(cDirs)] const VSQUERYRENAMEDIRECTORYFLAGS rgflags[],  
   [out] VSQUERYRENAMEDIRECTORYRESULTS *pSummaryResult,  
   [out, size_is(cDirs)] VSQUERYRENAMEDIRECTORYRESULTS rgResults[]  
);  

Call IVsTrackProjectDocuments2.OnQueryRenameDirectories when you want to rename directories in the project. This method must be called before the directories are renamed. The environment will return a flag indicating which directories can be renamed. After you have received authorization to rename the directories and you have renamed the directories, call OnAfterRenameDirectories to confirm that the directories have been renamed.

Note

All directory calls are optional. However, if you call one of the OnQuery* directory methods, then you are required to call the corresponding OnAfter* directory method if the OnQuery* call was successful.

Applies to