ProjectNode.AddItemWithSpecific Method

Adds an item to a project using a specific editor.

Namespace:  Microsoft.VisualStudio.Package
Assembly:  MPF.Project.NonShipping (in MPF.Project.NonShipping.dll)

Syntax

'宣言
Public Overridable Function AddItemWithSpecific ( _
    itemIdLoc As UInteger, _
    op As VSADDITEMOPERATION, _
    itemName As String, _
    filesToOpen As UInteger, _
    files As String(), _
    dlgOwner As IntPtr, _
    editorFlags As UInteger, _
    ByRef editorType As Guid, _
    physicalView As String, _
    ByRef logicalView As Guid, _
    result As VSADDRESULT() _
) As Integer
'使用
Dim instance As ProjectNode
Dim itemIdLoc As UInteger
Dim op As VSADDITEMOPERATION
Dim itemName As String
Dim filesToOpen As UInteger
Dim files As String()
Dim dlgOwner As IntPtr
Dim editorFlags As UInteger
Dim editorType As Guid
Dim physicalView As String
Dim logicalView As Guid
Dim result As VSADDRESULT()
Dim returnValue As Integer

returnValue = instance.AddItemWithSpecific(itemIdLoc, _
    op, itemName, filesToOpen, files, _
    dlgOwner, editorFlags, editorType, _
    physicalView, logicalView, result)
public virtual int AddItemWithSpecific(
    uint itemIdLoc,
    VSADDITEMOPERATION op,
    string itemName,
    uint filesToOpen,
    string[] files,
    IntPtr dlgOwner,
    uint editorFlags,
    ref Guid editorType,
    string physicalView,
    ref Guid logicalView,
    VSADDRESULT[] result
)
public:
virtual int AddItemWithSpecific(
    unsigned int itemIdLoc, 
    VSADDITEMOPERATION op, 
    String^ itemName, 
    unsigned int filesToOpen, 
    array<String^>^ files, 
    IntPtr dlgOwner, 
    unsigned int editorFlags, 
    Guid% editorType, 
    String^ physicalView, 
    Guid% logicalView, 
    array<VSADDRESULT>^ result
)
public function AddItemWithSpecific(
    itemIdLoc : uint, 
    op : VSADDITEMOPERATION, 
    itemName : String, 
    filesToOpen : uint, 
    files : String[], 
    dlgOwner : IntPtr, 
    editorFlags : uint, 
    editorType : Guid, 
    physicalView : String, 
    logicalView : Guid, 
    result : VSADDRESULT[]
) : int

Parameters

  • itemIdLoc
    Type: System.UInt32

    Identifier of the container folder for the item being added. Should be VSITEMID_ROOT or other valid item identifier.

  • filesToOpen
    Type: System.UInt32

    Number of items in files to open. Can be zero. This must be 1 if op is VSADDITEMOP_CLONEFILE or VSADDITEMOP_OPENDIRECTORY. If VSADDITEMOP_RUNWIZARD, it must be 1 or 2. See VSADDITEMOPERATION

  • files
    Type: []

    Array of file name strings. If op is VSADDITEMOP_CLONEFILE or VSADDITEMOP_OPENDIRECTORY, the first item (files[0]) in the array is the name of the file to clone or the directory to open. If it is VSADDITEMOP_RUNWIZARD, the first item (files [0]) is the name of the wizard to run, and the second item (files [1]) is the file name the user supplied (same as itemName). See VSADDITEMOPERATION

  • editorType
    Type: System.Guid%

    Unique identifier of the editor type.

  • logicalView
    Type: System.Guid%

    Name of the logical view.

  • result
    Type: []

    Array of VSADDRESULT enumerations indicating whether the item was successfully added to the project.

Return Value

Type: System.Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Implements

IVsProject3.AddItemWithSpecific(UInt32, VSADDITEMOPERATION, String, UInt32, [], IntPtr, UInt32, Guid%, String, Guid%, [])

Permissions

See Also

Reference

ProjectNode Class

ProjectNode Members

Microsoft.VisualStudio.Package Namespace