IVsTrackProjectDocuments2.OnQueryAddFiles Method
This method is called by a project to determine whether files can be added to the project.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
'Declaración
Function OnQueryAddFiles ( _
pProject As IVsProject, _
cFiles As Integer, _
rgpszMkDocuments As String(), _
rgFlags As VSQUERYADDFILEFLAGS(), _
<OutAttribute> pSummaryResult As VSQUERYADDFILERESULTS(), _
<OutAttribute> rgResults As VSQUERYADDFILERESULTS() _
) As Integer
'Uso
Dim instance As IVsTrackProjectDocuments2
Dim pProject As IVsProject
Dim cFiles As Integer
Dim rgpszMkDocuments As String()
Dim rgFlags As VSQUERYADDFILEFLAGS()
Dim pSummaryResult As VSQUERYADDFILERESULTS()
Dim rgResults As VSQUERYADDFILERESULTS()
Dim returnValue As Integer
returnValue = instance.OnQueryAddFiles(pProject, _
cFiles, rgpszMkDocuments, rgFlags, _
pSummaryResult, rgResults)
int OnQueryAddFiles(
IVsProject pProject,
int cFiles,
string[] rgpszMkDocuments,
VSQUERYADDFILEFLAGS[] rgFlags,
VSQUERYADDFILERESULTS[] pSummaryResult,
VSQUERYADDFILERESULTS[] rgResults
)
int OnQueryAddFiles(
[InAttribute] IVsProject^ pProject,
[InAttribute] int cFiles,
[InAttribute] array<String^>^ rgpszMkDocuments,
[InAttribute] array<VSQUERYADDFILEFLAGS>^ rgFlags,
[OutAttribute] array<VSQUERYADDFILERESULTS>^ pSummaryResult,
[OutAttribute] array<VSQUERYADDFILERESULTS>^ rgResults
)
abstract OnQueryAddFiles :
pProject:IVsProject *
cFiles:int *
rgpszMkDocuments:string[] *
rgFlags:VSQUERYADDFILEFLAGS[] *
pSummaryResult:VSQUERYADDFILERESULTS[] byref *
rgResults:VSQUERYADDFILERESULTS[] byref -> int
function OnQueryAddFiles(
pProject : IVsProject,
cFiles : int,
rgpszMkDocuments : String[],
rgFlags : VSQUERYADDFILEFLAGS[],
pSummaryResult : VSQUERYADDFILERESULTS[],
rgResults : VSQUERYADDFILERESULTS[]
) : int
Parameters
- pProject
Type: Microsoft.VisualStudio.Shell.Interop.IVsProject
[in] Project to which the files will be added.
- cFiles
Type: System.Int32
[in] Number of files to add. It is not valid for cFiles to be zero.
- rgpszMkDocuments
Type: array<System.String[]
[in] Array of paths for the files to be added. This is the same size as cFiles.
- rgFlags
Type: array<Microsoft.VisualStudio.Shell.Interop.VSQUERYADDFILEFLAGS[]
[in] Array of flags associated with each file. For more information, see VSQUERYADDFILEFLAGS.
- pSummaryResult
Type: array<Microsoft.VisualStudio.Shell.Interop.VSQUERYADDFILERESULTS[]
[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 in the array is no, then pSummaryResult is equal to VSQUERYADDFILERESULTS_AddNotOK; if the results for all files are yes, then pSummaryResult is equal to VSQUERYADDFILERESULTS_AddOK. For a list of pSummaryResult values, see VSQUERYADDFILERESULTS.
rgResults
Type: array<Microsoft.VisualStudio.Shell.Interop.VSQUERYADDFILERESULTS[]
[out] Array of results for each individual file. For a list of rgResults values, see VSQUERYADDFILERESULTS.Nota
If you pass in nulla null reference (Nothing in Visual Basic) for this parameter, then only the summary result will be returned (pSummaryResult).
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 IVsTrackProjectDocuments2.idl
HRESULT IVsTrackProjectDocuments2::OnQueryAddFiles(
[in] IVsProject *pProject,
[in] int cFiles,
[in, size_is(cFiles)] const LPCOLESTR rgpszMkDocuments[],
[in, size_is(cFiles)] const VSQUERYADDFILEFLAGS rgFlags[],
[out] VSQUERYADDFILERESULTS *pSummaryResult,
[out, size_is(cFiles)] VSQUERYADDFILERESULTS rgResults[]
);
Call this method when you want to add files to your project. This method must be called before the files are added to the project. The environment will return a flag indicating which files can be added. After you have received authorization to add the files and you have added the files, call OnAfterAddFilesEx or OnAfterAddFiles to confirm that the files have been added.
.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
IVsTrackProjectDocuments2 Interface