共用方式為


IVsTrackProjectDocuments2.OnQueryRemoveDirectories Method

Definition

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

public:
 int OnQueryRemoveDirectories(Microsoft::VisualStudio::Shell::Interop::IVsProject ^ pProject, int cDirectories, cli::array <System::String ^> ^ rgpszMkDocuments, cli::array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEDIRECTORYFLAGS> ^ rgFlags, cli::array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEDIRECTORYRESULTS> ^ pSummaryResult, cli::array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEDIRECTORYRESULTS> ^ rgResults);
public:
 int OnQueryRemoveDirectories(Microsoft::VisualStudio::Shell::Interop::IVsProject ^ pProject, int cDirectories, Platform::Array <Platform::String ^> ^ rgpszMkDocuments, Platform::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEDIRECTORYFLAGS> ^ rgFlags, Platform::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEDIRECTORYRESULTS> ^ pSummaryResult, Platform::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEDIRECTORYRESULTS> ^ rgResults);
int OnQueryRemoveDirectories(Microsoft::VisualStudio::Shell::Interop::IVsProject const & pProject, int cDirectories, std::Array <std::wstring const &> const & rgpszMkDocuments, std::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEDIRECTORYFLAGS> const & rgFlags, std::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEDIRECTORYRESULTS> const & pSummaryResult, std::Array <Microsoft::VisualStudio::Shell::Interop::VSQUERYREMOVEDIRECTORYRESULTS> const & rgResults);
public int OnQueryRemoveDirectories (Microsoft.VisualStudio.Shell.Interop.IVsProject pProject, int cDirectories, string[] rgpszMkDocuments, Microsoft.VisualStudio.Shell.Interop.VSQUERYREMOVEDIRECTORYFLAGS[] rgFlags, Microsoft.VisualStudio.Shell.Interop.VSQUERYREMOVEDIRECTORYRESULTS[] pSummaryResult, Microsoft.VisualStudio.Shell.Interop.VSQUERYREMOVEDIRECTORYRESULTS[] rgResults);
abstract member OnQueryRemoveDirectories : Microsoft.VisualStudio.Shell.Interop.IVsProject * int * string[] * Microsoft.VisualStudio.Shell.Interop.VSQUERYREMOVEDIRECTORYFLAGS[] * Microsoft.VisualStudio.Shell.Interop.VSQUERYREMOVEDIRECTORYRESULTS[] * Microsoft.VisualStudio.Shell.Interop.VSQUERYREMOVEDIRECTORYRESULTS[] -> int
Public Function OnQueryRemoveDirectories (pProject As IVsProject, cDirectories As Integer, rgpszMkDocuments As String(), rgFlags As VSQUERYREMOVEDIRECTORYFLAGS(), pSummaryResult As VSQUERYREMOVEDIRECTORYRESULTS(), rgResults As VSQUERYREMOVEDIRECTORYRESULTS()) As Integer

Parameters

pProject
IVsProject

[in] Project containing the directories to remove.

cDirectories
Int32

[in] Number of directories to remove.

rgpszMkDocuments
String[]

[in] Array of paths for the directories to remove.

rgFlags
VSQUERYREMOVEDIRECTORYFLAGS[]

[in] Array of directory removal flags. For a list of rgFlags values, see VSQUERYREMOVEDIRECTORYFLAGS

pSummaryResult
VSQUERYREMOVEDIRECTORYRESULTS[]

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

rgResults
VSQUERYREMOVEDIRECTORYRESULTS[]

[out] Array of results[]. For a list of rgResults values, see VSQUERYREMOVEDIRECTORYRESULTS. 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::OnQueryRemoveDirectories(  
   [in] IVsProject *pProject,  
   [in] int cDirectories,  
   [in, size_is(cDirectories)] const LPCOLESTR rgpszMkDocuments[],  
   [in, size_is(cDirectories)] const VSQUERYREMOVEDIRECTORYFLAGS rgFlags[],  
   [out] VSQUERYREMOVEDIRECTORYRESULTS *pSummaryResult,  
   [out, size_is(cDirectories)] VSQUERYREMOVEDIRECTORYRESULTS rgResults[]  
);  

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

Note

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.

Applies to