Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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)

int OnQueryRenameFiles (
	[InAttribute] IVsProject pProject,
	[InAttribute] int cFiles,
	[InAttribute] string[] rgszMkOldNames,
	[InAttribute] string[] rgszMkNewNames,
	[InAttribute] VSQUERYRENAMEFILEFLAGS[] rgFlags,
	[OutAttribute] VSQUERYRENAMEFILERESULTS[] pSummaryResult,
	[OutAttribute] VSQUERYRENAMEFILERESULTS[] rgResults
)
int OnQueryRenameFiles (
	/** @attribute InAttribute() */ IVsProject pProject, 
	/** @attribute InAttribute() */ int cFiles, 
	/** @attribute InAttribute() */ String[] rgszMkOldNames, 
	/** @attribute InAttribute() */ String[] rgszMkNewNames, 
	/** @attribute InAttribute() */ VSQUERYRENAMEFILEFLAGS[] rgFlags, 
	/** @attribute OutAttribute() */ VSQUERYRENAMEFILERESULTS[] pSummaryResult, 
	/** @attribute OutAttribute() */ VSQUERYRENAMEFILERESULTS[] rgResults
)
function OnQueryRenameFiles (
	pProject : IVsProject, 
	cFiles : int, 
	rgszMkOldNames : String[], 
	rgszMkNewNames : String[], 
	rgFlags : VSQUERYRENAMEFILEFLAGS[], 
	pSummaryResult : VSQUERYRENAMEFILERESULTS[], 
	rgResults : VSQUERYRENAMEFILERESULTS[]
) : int

Parameters

pProject

[in] Project requesting to rename files.

cFiles

[in] Number of files to rename.

rgszMkOldNames

[in] Array of old file names.

rgszMkNewNames

[in] Array of new file names.

rgFlags

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

pSummaryResult

[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

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

Return Value

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

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.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.