次の方法で共有


IVsTrackProjectDocuments2.OnQueryAddDirectories Method

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

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

Syntax

'宣言
Function OnQueryAddDirectories ( _
    pProject As IVsProject, _
    cDirectories As Integer, _
    rgpszMkDocuments As String(), _
    rgFlags As VSQUERYADDDIRECTORYFLAGS(), _
    <OutAttribute> pSummaryResult As VSQUERYADDDIRECTORYRESULTS(), _
    <OutAttribute> rgResults As VSQUERYADDDIRECTORYRESULTS() _
) As Integer
'使用
Dim instance As IVsTrackProjectDocuments2
Dim pProject As IVsProject
Dim cDirectories As Integer
Dim rgpszMkDocuments As String()
Dim rgFlags As VSQUERYADDDIRECTORYFLAGS()
Dim pSummaryResult As VSQUERYADDDIRECTORYRESULTS()
Dim rgResults As VSQUERYADDDIRECTORYRESULTS()
Dim returnValue As Integer

returnValue = instance.OnQueryAddDirectories(pProject, _
    cDirectories, rgpszMkDocuments, _
    rgFlags, pSummaryResult, rgResults)
int OnQueryAddDirectories(
    IVsProject pProject,
    int cDirectories,
    string[] rgpszMkDocuments,
    VSQUERYADDDIRECTORYFLAGS[] rgFlags,
    VSQUERYADDDIRECTORYRESULTS[] pSummaryResult,
    VSQUERYADDDIRECTORYRESULTS[] rgResults
)
int OnQueryAddDirectories(
    [InAttribute] IVsProject^ pProject, 
    [InAttribute] int cDirectories, 
    [InAttribute] array<String^>^ rgpszMkDocuments, 
    [InAttribute] array<VSQUERYADDDIRECTORYFLAGS>^ rgFlags, 
    [OutAttribute] array<VSQUERYADDDIRECTORYRESULTS>^ pSummaryResult, 
    [OutAttribute] array<VSQUERYADDDIRECTORYRESULTS>^ rgResults
)
function OnQueryAddDirectories(
    pProject : IVsProject, 
    cDirectories : int, 
    rgpszMkDocuments : String[], 
    rgFlags : VSQUERYADDDIRECTORYFLAGS[], 
    pSummaryResult : VSQUERYADDDIRECTORYRESULTS[], 
    rgResults : VSQUERYADDDIRECTORYRESULTS[]
) : int

Parameters

  • cDirectories
    Type: System.Int32

    [in] Number of directories to be added.

  • rgpszMkDocuments
    Type: []

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

  • rgFlags
    Type: []

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

  • rgResults
    Type: []

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

    注意

    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

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

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

注意

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.

Permissions

See Also

Reference

IVsTrackProjectDocuments2 Interface

IVsTrackProjectDocuments2 Members

Microsoft.VisualStudio.Shell.Interop Namespace