This documentation is archived and is not being maintained.

IVsTrackProjectDocuments2.OnQueryRemoveDirectories Method

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

Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in microsoft.visualstudio.shell.interop.dll)

int OnQueryRemoveDirectories (
	[InAttribute] IVsProject pProject,
	[InAttribute] int cDirectories,
	[InAttribute] string[] rgpszMkDocuments,
	[InAttribute] VSQUERYREMOVEDIRECTORYFLAGS[] rgFlags,
	[OutAttribute] VSQUERYREMOVEDIRECTORYRESULTS[] pSummaryResult,
	[OutAttribute] VSQUERYREMOVEDIRECTORYRESULTS[] rgResults
)
int OnQueryRemoveDirectories (
	/** @attribute InAttribute() */ IVsProject pProject, 
	/** @attribute InAttribute() */ int cDirectories, 
	/** @attribute InAttribute() */ String[] rgpszMkDocuments, 
	/** @attribute InAttribute() */ VSQUERYREMOVEDIRECTORYFLAGS[] rgFlags, 
	/** @attribute OutAttribute() */ VSQUERYREMOVEDIRECTORYRESULTS[] pSummaryResult, 
	/** @attribute OutAttribute() */ VSQUERYREMOVEDIRECTORYRESULTS[] rgResults
)
function OnQueryRemoveDirectories (
	pProject : IVsProject, 
	cDirectories : int, 
	rgpszMkDocuments : String[], 
	rgFlags : VSQUERYREMOVEDIRECTORYFLAGS[], 
	pSummaryResult : VSQUERYREMOVEDIRECTORYRESULTS[], 
	rgResults : VSQUERYREMOVEDIRECTORYRESULTS[]
) : int

Parameters

pProject

[in] Project containing the directories to remove.

cDirectories

[in] Number of directories to remove.

rgpszMkDocuments

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

rgFlags

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

pSummaryResult

[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

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

NoteNote

If you pass in a null reference (Nothing in Visual Basic) for this parameter, then only the summary result will be returned (pSummaryResult).

Return Value

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

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.

NoteNote

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.

Show: