Export (0) Print
Expand All

IVsTrackProjectDocuments2.OnQueryRenameDirectories Method

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

Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in microsoft.visualstudio.shell.interop.dll)

int OnQueryRenameDirectories (
	[InAttribute] IVsProject pProject,
	[InAttribute] int cDirs,
	[InAttribute] string[] rgszMkOldNames,
	[InAttribute] string[] rgszMkNewNames,
	[InAttribute] VSQUERYRENAMEDIRECTORYFLAGS[] rgFlags,
	[OutAttribute] VSQUERYRENAMEDIRECTORYRESULTS[] pSummaryResult,
	[OutAttribute] VSQUERYRENAMEDIRECTORYRESULTS[] rgResults
)
int OnQueryRenameDirectories (
	/** @attribute InAttribute() */ IVsProject pProject, 
	/** @attribute InAttribute() */ int cDirs, 
	/** @attribute InAttribute() */ String[] rgszMkOldNames, 
	/** @attribute InAttribute() */ String[] rgszMkNewNames, 
	/** @attribute InAttribute() */ VSQUERYRENAMEDIRECTORYFLAGS[] rgFlags, 
	/** @attribute OutAttribute() */ VSQUERYRENAMEDIRECTORYRESULTS[] pSummaryResult, 
	/** @attribute OutAttribute() */ VSQUERYRENAMEDIRECTORYRESULTS[] rgResults
)
function OnQueryRenameDirectories (
	pProject : IVsProject, 
	cDirs : int, 
	rgszMkOldNames : String[], 
	rgszMkNewNames : String[], 
	rgFlags : VSQUERYRENAMEDIRECTORYFLAGS[], 
	pSummaryResult : VSQUERYRENAMEDIRECTORYRESULTS[], 
	rgResults : VSQUERYRENAMEDIRECTORYRESULTS[]
) : int

Parameters

pProject

[in] Project containing the directories to rename.

cDirs

[in] Number of directories to be renamed.

rgszMkOldNames

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

rgszMkNewNames

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

rgFlags

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

pSummaryResult

[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

[out] Array of results. For a list of rgResults values, see VSQUERYRENAMEDIRECTORYRESULTS.

NoteNote

If you pass in a null reference (Nothing in Visual Basic) for this parameter, then only the summary result will be returned (pSummaryResult).

Return Value

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

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.

NoteNote

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.

Community Additions

ADD
Show:
© 2015 Microsoft