共用方式為


_dispVCProjectEngineEvents.ItemRemoved Method

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Signifies that the specified item was removed from the project.

Namespace:  Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)

Syntax

'宣告
Sub ItemRemoved ( _
    Item As Object, _
    ItemParent As Object _
)
void ItemRemoved(
    Object Item,
    Object ItemParent
)
void ItemRemoved(
    [InAttribute] Object^ Item, 
    [InAttribute] Object^ ItemParent
)
abstract ItemRemoved : 
        Item:Object * 
        ItemParent:Object -> unit 
function ItemRemoved(
    Item : Object, 
    ItemParent : Object
)

Parameters

Remarks

The ItemRemoved method fires when an item is removed from a VCFilter, or VCFile object.

Examples

[Visual Basic]

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE

Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub ItemRemoved(ByVal item As Object, ByVal parent As Object)
        Dim vcitem As VCProjectItem
        vcitem = item
        MsgBox(vcitem.ItemName)
    End Sub

    Sub Main()
        Dim projEngine As VCProjectEngine
        Dim evt As VCProjectEngineEvents
        Dim prj As VCProject
        Dim col As IVCCollection
        Dim file As VCFile
        prj = DTE.Solution.Projects.Item(1).Object
        projEngine = prj.VCProjectEngine
        evt = projEngine.Events
        AddHandler evt.ItemRemoved, AddressOf ItemRemoved
        col = prj.files
        file = col.Item(1)
        prj.RemoveFile(file)
    End Sub
End Module

.NET Framework Security

See Also

Reference

_dispVCProjectEngineEvents Interface

Microsoft.VisualStudio.VCProjectEngine Namespace