共用方式為


IVsAddProjectItemDlg2.AddExistingProjectItems Method

Adds existing project items.

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

Syntax

'宣告
Function AddExistingProjectItems ( _
    itemidLoc As UInteger, _
    ByRef rguidProject As Guid, _
    pProject As IVsProject, _
    grfEditorFlags As UInteger, _
    ByRef rguidEditorType As Guid, _
    pszPhysicalView As String, _
    ByRef rguidLogicalView As Guid, _
    cFilesToAdd As UInteger, _
    rgpszFilesToAdd As String() _
) As Integer
'用途
Dim instance As IVsAddProjectItemDlg2
Dim itemidLoc As UInteger
Dim rguidProject As Guid
Dim pProject As IVsProject
Dim grfEditorFlags As UInteger
Dim rguidEditorType As Guid
Dim pszPhysicalView As String
Dim rguidLogicalView As Guid
Dim cFilesToAdd As UInteger
Dim rgpszFilesToAdd As String()
Dim returnValue As Integer

returnValue = instance.AddExistingProjectItems(itemidLoc, _
    rguidProject, pProject, grfEditorFlags, _
    rguidEditorType, pszPhysicalView, _
    rguidLogicalView, cFilesToAdd, rgpszFilesToAdd)
int AddExistingProjectItems(
    uint itemidLoc,
    ref Guid rguidProject,
    IVsProject pProject,
    uint grfEditorFlags,
    ref Guid rguidEditorType,
    string pszPhysicalView,
    ref Guid rguidLogicalView,
    uint cFilesToAdd,
    string[] rgpszFilesToAdd
)
int AddExistingProjectItems(
    [InAttribute] unsigned int itemidLoc, 
    [InAttribute] Guid% rguidProject, 
    [InAttribute] IVsProject^ pProject, 
    [InAttribute] unsigned int grfEditorFlags, 
    [InAttribute] Guid% rguidEditorType, 
    [InAttribute] String^ pszPhysicalView, 
    [InAttribute] Guid% rguidLogicalView, 
    [InAttribute] unsigned int cFilesToAdd, 
    [InAttribute] array<String^>^ rgpszFilesToAdd
)
abstract AddExistingProjectItems : 
        itemidLoc:uint32 * 
        rguidProject:Guid byref * 
        pProject:IVsProject * 
        grfEditorFlags:uint32 * 
        rguidEditorType:Guid byref * 
        pszPhysicalView:string * 
        rguidLogicalView:Guid byref * 
        cFilesToAdd:uint32 * 
        rgpszFilesToAdd:string[] -> int 
function AddExistingProjectItems(
    itemidLoc : uint, 
    rguidProject : Guid, 
    pProject : IVsProject, 
    grfEditorFlags : uint, 
    rguidEditorType : Guid, 
    pszPhysicalView : String, 
    rguidLogicalView : Guid, 
    cFilesToAdd : uint, 
    rgpszFilesToAdd : String[]
) : int

Parameters

  • itemidLoc
    Type: System.UInt32
    [in] Item identifier of the folder in the project to which items should be added.
  • rguidProject
    Type: System.Guid%
    [in] Unique identifier of the project.
  • rguidEditorType
    Type: System.Guid%
    [in] Editor type with which to open (if supported).
  • pszPhysicalView
    Type: System.String
    [in] Physical view with which to open (if supported).
  • rguidLogicalView
    Type: System.Guid%
    [in] Logical view with which to open (if supported).
  • rgpszFilesToAdd
    Type: array<System.String[]
    [in, size_is(cFilesToAdd)] Array of files whose actual number is cFilesToAdd.

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 vsshell.idl:

HRESULT IVsAddProjectItemDlg2::AddExistingProjectItems(
   [in] VSITEMID itemidLoc,
   [in] REFGUID rguidProject,
   [in] IVsProject *pProject,
   [in] VSSPECIFICEDITORFLAGS grfEditorFlags,
   [in] REFGUID rguidEditorType,
   [in] LPCOLESTR pszPhysicalView,
   [in] REFGUID rguidLogicalView,
   [in] ULONG cFilesToAdd,
   [in, size_is(cFilesToAdd)] LPCOLESTR rgpszFilesToAdd[]
);

.NET Framework Security

See Also

Reference

IVsAddProjectItemDlg2 Interface

IVsAddProjectItemDlg2 Members

Microsoft.VisualStudio.Shell.Interop Namespace