共用方式為


IVsTrackProjectDocumentsEvents2.OnQueryRenameDirectories Method

This method notifies the client when a project has requested to rename directories.

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

Syntax

'宣告
Function OnQueryRenameDirectories ( _
    pProject As IVsProject, _
    cDirs As Integer, _
    rgszMkOldNames As String(), _
    rgszMkNewNames As String(), _
    rgFlags As VSQUERYRENAMEDIRECTORYFLAGS(), _
    <OutAttribute> pSummaryResult As VSQUERYRENAMEDIRECTORYRESULTS(), _
    <OutAttribute> rgResults As VSQUERYRENAMEDIRECTORYRESULTS() _
) As Integer
'用途
Dim instance As IVsTrackProjectDocumentsEvents2
Dim pProject As IVsProject
Dim cDirs As Integer
Dim rgszMkOldNames As String()
Dim rgszMkNewNames As String()
Dim rgFlags As VSQUERYRENAMEDIRECTORYFLAGS()
Dim pSummaryResult As VSQUERYRENAMEDIRECTORYRESULTS()
Dim rgResults As VSQUERYRENAMEDIRECTORYRESULTS()
Dim returnValue As Integer

returnValue = instance.OnQueryRenameDirectories(pProject, _
    cDirs, rgszMkOldNames, rgszMkNewNames, _
    rgFlags, pSummaryResult, rgResults)
int OnQueryRenameDirectories(
    IVsProject pProject,
    int cDirs,
    string[] rgszMkOldNames,
    string[] rgszMkNewNames,
    VSQUERYRENAMEDIRECTORYFLAGS[] rgFlags,
    VSQUERYRENAMEDIRECTORYRESULTS[] pSummaryResult,
    VSQUERYRENAMEDIRECTORYRESULTS[] rgResults
)
int OnQueryRenameDirectories(
    [InAttribute] IVsProject^ pProject, 
    [InAttribute] int cDirs, 
    [InAttribute] array<String^>^ rgszMkOldNames, 
    [InAttribute] array<String^>^ rgszMkNewNames, 
    [InAttribute] array<VSQUERYRENAMEDIRECTORYFLAGS>^ rgFlags, 
    [OutAttribute] array<VSQUERYRENAMEDIRECTORYRESULTS>^ pSummaryResult, 
    [OutAttribute] array<VSQUERYRENAMEDIRECTORYRESULTS>^ rgResults
)
abstract OnQueryRenameDirectories : 
        pProject:IVsProject * 
        cDirs:int * 
        rgszMkOldNames:string[] * 
        rgszMkNewNames:string[] * 
        rgFlags:VSQUERYRENAMEDIRECTORYFLAGS[] * 
        pSummaryResult:VSQUERYRENAMEDIRECTORYRESULTS[] byref * 
        rgResults:VSQUERYRENAMEDIRECTORYRESULTS[] byref -> int 
function OnQueryRenameDirectories(
    pProject : IVsProject, 
    cDirs : int, 
    rgszMkOldNames : String[], 
    rgszMkNewNames : String[], 
    rgFlags : VSQUERYRENAMEDIRECTORYFLAGS[], 
    pSummaryResult : VSQUERYRENAMEDIRECTORYRESULTS[], 
    rgResults : VSQUERYRENAMEDIRECTORYRESULTS[]
) : int

Parameters

  • cDirs
    Type: System.Int32
    [in] Number of directories to rename.
  • rgszMkOldNames
    Type: array<System.String[]
    [in] Array of paths for the old directory names.
  • rgszMkNewNames
    Type: array<System.String[]
    [in] Array of paths for the new directory names.

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::OnQueryRenameDirectories(
   [in] IVsProject *pProject,
   [in] int cDirs, [in, size_is(cDirs)] const LPCOLESTR rgszMkOldNames[],
   [in, size_is(cDirs)] const LPCOLESTR rgszMkNewNames[],
   [in, size_is(cDirs)] const VSQUERYRENAMEDIRECTORYFLAGS rgflags[],
   [out] VSQUERYRENAMEDIRECTORYRESULTS *pSummaryResult,
   [out, size_is(cDirs)] VSQUERYRENAMEDIRECTORYRESULTS rgResults[]
);

Use IVsTrackProjectDocumentsEvents2.OnQueryRenameDirectories to indicate whether specified directories can be renamed in the project. Deny a query only if allowing the operation would compromise your stable state. For example, source control denies rename queries if the new name conflicts with an existing directory already under source control.

.NET Framework Security

See Also

Reference

IVsTrackProjectDocumentsEvents2 Interface

IVsTrackProjectDocumentsEvents2 Members

Microsoft.VisualStudio.Shell.Interop Namespace