Compartir a través de


IVsMenuEditor.AddMenuItem Method

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

Syntax

'Declaración
Function AddMenuItem ( _
    pIMI As IVsMenuItem, _
    pIMIParent As IVsMenuItem, _
    pIMIInsertAfter As IVsMenuItem _
) As Integer
'Uso
Dim instance As IVsMenuEditor
Dim pIMI As IVsMenuItem
Dim pIMIParent As IVsMenuItem
Dim pIMIInsertAfter As IVsMenuItem
Dim returnValue As Integer

returnValue = instance.AddMenuItem(pIMI, _
    pIMIParent, pIMIInsertAfter)
int AddMenuItem(
    IVsMenuItem pIMI,
    IVsMenuItem pIMIParent,
    IVsMenuItem pIMIInsertAfter
)
int AddMenuItem(
    [InAttribute] IVsMenuItem^ pIMI, 
    [InAttribute] IVsMenuItem^ pIMIParent, 
    [InAttribute] IVsMenuItem^ pIMIInsertAfter
)
abstract AddMenuItem : 
        pIMI:IVsMenuItem * 
        pIMIParent:IVsMenuItem * 
        pIMIInsertAfter:IVsMenuItem -> int 
function AddMenuItem(
    pIMI : IVsMenuItem, 
    pIMIParent : IVsMenuItem, 
    pIMIInsertAfter : IVsMenuItem
) : int

Parameters

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 IVsMenuEditor::AddMenuItem(
   [in]IVsMenuItem *pIMI, [in]IVsMenuItem *pIMIParent, [in]IVsMenuItem *pIMIInsertAfter);

Only pIMIParent and pIMIInsertAfter can be nulla null reference (Nothing in Visual Basic) for first item in top-level menu. Otherwise, only pIMIParent or pIMIInsertAfter can be valid

.NET Framework Security

See Also

Reference

IVsMenuEditor Interface

IVsMenuEditor Members

Microsoft.VisualStudio.Shell.Interop Namespace