次の方法で共有


IVsTrackProjectDocuments2.OnQueryRemoveFiles Method

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

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'宣言
Function OnQueryRemoveFiles ( _
    pProject As IVsProject, _
    cFiles As Integer, _
    rgpszMkDocuments As String(), _
    rgFlags As VSQUERYREMOVEFILEFLAGS(), _
    <OutAttribute> pSummaryResult As VSQUERYREMOVEFILERESULTS(), _
    <OutAttribute> rgResults As VSQUERYREMOVEFILERESULTS() _
) As Integer
'使用
Dim instance As IVsTrackProjectDocuments2
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

  • rgpszMkDocuments
    Type: array<System.String[]
    [in] Array of paths for the files to be removed.

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::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[]
);

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

.NET Framework Security

See Also

Reference

IVsTrackProjectDocuments2 Interface

IVsTrackProjectDocuments2 Members

Microsoft.VisualStudio.Shell.Interop Namespace