다음을 통해 공유


IVsTrackProjectDocumentsEvents2.OnQueryAddDirectories Method

Definition

This method notifies the client when a project has requested to add directories.

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

Parameters

pProject
IVsProject

[in] Project to which the directories will be added.

cDirectories
Int32

[in] Number of directories to add.

rgpszMkDocuments
String[]

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

rgFlags
VSQUERYADDDIRECTORYFLAGS[]

[in] Flags identifying information about each directory. For a list of rgFlags values, see VSQUERYADDDIRECTORYFLAGS.

pSummaryResult
VSQUERYADDDIRECTORYRESULTS[]

[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 VSQUERYADDDIRECTORYRESULTS_AddNotOK; if the results for all directories are yes, then pSummaryResult is equal to VSQUERYADDDIRECTORYRESULTS_AddOK. For a list of pSummaryResult values, see VSQUERYADDDIRECTORYRESULTS.

rgResults
VSQUERYADDDIRECTORYRESULTS[]

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

Returns

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

Remarks

COM Signature

From IVsTrackProjectDocumentsEvents2.idl

HRESULT IVsTrackProjectDocumentsEvents2::OnQueryAddDirectories(  
   [in] IVsProject *pProject,  
   [in] int cDirectories,  
   [in, size_is(cDirectories)] const LPCOLESTR rgpszMkDocuments[],  
   [in, size_is(cDirectories)] const VSQUERYADDDIRECTORYFLAGS rgFlags[],  
   [out] VSQUERYADDDIRECTORYRESULTS *pSummaryResult,  
   [out, size_is(cDirectories)] VSQUERYADDDIRECTORYRESULTS rgResults[]  
);  

Use IVsTrackProjectDocumentsEvents2.OnQueryAddDirectories to indicate whether specified directories can be added to the project. Deny a query only if allowing the operation would compromise your stable state. For example, source control denies add queries if a file being added conflicts with an existing file already under source control.

Applies to