IVsTrackProjectDocumentsEvents2.OnQueryRemoveFiles Method

Definition

This method notifies the client when a project has requested to remove files.

C++/CX
public:
 int OnQueryRemoveFiles(Microsoft::VisualStudio::Shell::Interop::IVsProject ^ pProject, int cFiles, Platform::Array <Platform::String ^> ^ rgpszMkDocuments, Platform::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEFILEFLAGS> ^ rgFlags, Platform::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEFILERESULTS> ^ pSummaryResult, Platform::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEFILERESULTS> ^ rgResults);

Parameters

pProject
IVsProject

[in] Project from which the files will be removed.

cFiles
Int32

[in] Number of files to remove.

rgpszMkDocuments
String[]

[in] Array of paths for the files to be removed.

rgFlags
VSQUERYREMOVEFILEFLAGS[]

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

pSummaryResult
VSQUERYREMOVEFILERESULTS[]

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

rgResults
VSQUERYREMOVEFILERESULTS[]

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

Returns

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

Remarks

COM Signature

From IVsTrackProjectDocumentsEvents2.idl

cpp#
HRESULT IVsTrackProjectDocumentsEvents2::OnQueryRemoveFiles(  
   [in] IVsProject *pProject,  
   [in] int cFiles, [in, size_is(cFiles)] const LPCOLESTR rgpszMkDocuments[],  
   [in, size_is(cFiles)] const VSQUERYREMOVEFILEFLAGS rgFlags[],  
   [out] VSQUERYREMOVEFILERESULTS *pSummaryResult,  
   [out, size_is(cFiles)] VSQUERYREMOVEFILERESULTS rgResults[]  
);  

Use IVsTrackProjectDocumentsEvents2.OnQueryRemoveFiles to indicate whether specified files can be removed from the project. Only deny a query if allowing the operation would compromise your stable state. For example, source control may deny remove queries if a file being removed is currently checked out.

Applies to

Proizvod Verzije
Visual Studio SDK 2015, 2017, 2019, 2022