Partager via


IVsTrackProjectDocuments2.OnQueryRemoveFiles Method

Definition

This method is called by a project to determine whether files can be removed from the project.

public:
 int OnQueryRemoveFiles(Microsoft::VisualStudio::Shell::Interop::IVsProject ^ pProject, int cFiles, cli::array <System::String ^> ^ rgpszMkDocuments, cli::array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEFILEFLAGS> ^ rgFlags, cli::array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEFILERESULTS> ^ pSummaryResult, cli::array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEFILERESULTS> ^ rgResults);
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);
int OnQueryRemoveFiles(Microsoft::VisualStudio::Shell::Interop::IVsProject const & pProject, int cFiles, std::Array <std::wstring const &> const & rgpszMkDocuments, std::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEFILEFLAGS> const & rgFlags, std::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEFILERESULTS> const & pSummaryResult, std::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEFILERESULTS> const & rgResults);
public int OnQueryRemoveFiles (Microsoft.VisualStudio.Shell.Interop.IVsProject pProject, int cFiles, string[] rgpszMkDocuments, Microsoft.VisualStudio.Shell.Interop.VSQUERYREMOVEFILEFLAGS[] rgFlags, Microsoft.VisualStudio.Shell.Interop.VSQUERYREMOVEFILERESULTS[] pSummaryResult, Microsoft.VisualStudio.Shell.Interop.VSQUERYREMOVEFILERESULTS[] rgResults);
abstract member OnQueryRemoveFiles : Microsoft.VisualStudio.Shell.Interop.IVsProject * int * string[] * Microsoft.VisualStudio.Shell.Interop.VSQUERYREMOVEFILEFLAGS[] * Microsoft.VisualStudio.Shell.Interop.VSQUERYREMOVEFILERESULTS[] * Microsoft.VisualStudio.Shell.Interop.VSQUERYREMOVEFILERESULTS[] -> int
Public Function OnQueryRemoveFiles (pProject As IVsProject, cFiles As Integer, rgpszMkDocuments As String(), rgFlags As VSQUERYREMOVEFILEFLAGS(), pSummaryResult As VSQUERYREMOVEFILERESULTS(), rgResults As VSQUERYREMOVEFILERESULTS()) As Integer

Parameters

pProject
IVsProject

[in] Project containing the files to remove.

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. 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::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[]  
);  

Call this method when you want to remove files from the project. This method must be called before the files are removed. The environment will return a flag indicating which files can be removed. After you have received authorization to remove the files and you have removed them, call OnAfterRemoveFiles to confirm that the files have been removed.

Applies to