IVsTrackProjectDocumentsEvents2.OnQueryRemoveFiles Method
This method notifies the client when a project has requested to remove files.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
'Déclaration
Function OnQueryRemoveFiles ( _
pProject As IVsProject, _
cFiles As Integer, _
rgpszMkDocuments As String(), _
rgFlags As VSQUERYREMOVEFILEFLAGS(), _
<OutAttribute> pSummaryResult As VSQUERYREMOVEFILERESULTS(), _
<OutAttribute> rgResults As VSQUERYREMOVEFILERESULTS() _
) As Integer
'Utilisation
Dim instance As IVsTrackProjectDocumentsEvents2
Dim pProject As IVsProject
Dim cFiles As Integer
Dim rgpszMkDocuments As String()
Dim rgFlags As VSQUERYREMOVEFILEFLAGS()
Dim pSummaryResult As VSQUERYREMOVEFILERESULTS()
Dim rgResults As VSQUERYREMOVEFILERESULTS()
Dim returnValue As Integer
returnValue = instance.OnQueryRemoveFiles(pProject, _
cFiles, rgpszMkDocuments, rgFlags, _
pSummaryResult, rgResults)
int OnQueryRemoveFiles(
IVsProject pProject,
int cFiles,
string[] rgpszMkDocuments,
VSQUERYREMOVEFILEFLAGS[] rgFlags,
VSQUERYREMOVEFILERESULTS[] pSummaryResult,
VSQUERYREMOVEFILERESULTS[] rgResults
)
int OnQueryRemoveFiles(
[InAttribute] IVsProject^ pProject,
[InAttribute] int cFiles,
[InAttribute] array<String^>^ rgpszMkDocuments,
[InAttribute] array<VSQUERYREMOVEFILEFLAGS>^ rgFlags,
[OutAttribute] array<VSQUERYREMOVEFILERESULTS>^ pSummaryResult,
[OutAttribute] array<VSQUERYREMOVEFILERESULTS>^ rgResults
)
abstract OnQueryRemoveFiles :
pProject:IVsProject *
cFiles:int *
rgpszMkDocuments:string[] *
rgFlags:VSQUERYREMOVEFILEFLAGS[] *
pSummaryResult:VSQUERYREMOVEFILERESULTS[] byref *
rgResults:VSQUERYREMOVEFILERESULTS[] byref -> int
function OnQueryRemoveFiles(
pProject : IVsProject,
cFiles : int,
rgpszMkDocuments : String[],
rgFlags : VSQUERYREMOVEFILEFLAGS[],
pSummaryResult : VSQUERYREMOVEFILERESULTS[],
rgResults : VSQUERYREMOVEFILERESULTS[]
) : int
Parameters
- pProject
Type: Microsoft.VisualStudio.Shell.Interop.IVsProject
[in] Project from which the files will be removed.
- cFiles
Type: System.Int32
[in] Number of files to remove.
- rgpszMkDocuments
Type: array<System.String[]
[in] Array of paths for the files to be removed.
- rgFlags
Type: array<Microsoft.VisualStudio.Shell.Interop.VSQUERYREMOVEFILEFLAGS[]
[in] Array of flags. For a list of rgFlags values, see VSQUERYREMOVEFILEFLAGS.
- pSummaryResult
Type: array<Microsoft.VisualStudio.Shell.Interop.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
Type: array<Microsoft.VisualStudio.Shell.Interop.VSQUERYREMOVEFILERESULTS[]
[out] Array of results[].For a list of rgResults values, see VSQUERYREMOVEFILERESULTS.
Return Value
Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
COM Signature
From IVsTrackProjectDocumentsEvents2.idl
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.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
IVsTrackProjectDocumentsEvents2 Interface