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
- pProject
Type: Microsoft.VisualStudio.Shell.Interop.IVsProject
[in] Project in which the files will be renamed.
- cFiles
Type: System.Int32
[in] Number of files to rename in the project.
- rgszMkOldNames
Type: array<System.String[]
[in] Array of paths for the old file names.
- rgszMkNewNames
Type: array<System.String[]
[in] Array of paths for the new file names.
- rgFlags
Type: array<Microsoft.VisualStudio.Shell.Interop.VSQUERYRENAMEFILEFLAGS[]
[in] Array of flags. For a list of rgFlags values, see VSQUERYRENAMEFILEFLAGS.
- pSummaryResult
Type: array<Microsoft.VisualStudio.Shell.Interop.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
Type: array<Microsoft.VisualStudio.Shell.Interop.VSQUERYRENAMEFILERESULTS[]
[out] Array of results. For a list of rgResults values, see VSQUERYRENAMEFILERESULTS.
Note If you pass in nulla null reference (Nothing in Visual Basic) for this parameter, then only the summary result will be returned (pSummaryResult).
Return Value
Type: System.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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.