_dispVCProjectEngineEvents.ItemRemoved(Object, Object) Method

Definition

Signifies that the specified item was removed from the project.

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

public:
 void ItemRemoved(System::Object ^ Item, System::Object ^ ItemParent);
public:
 void ItemRemoved(Platform::Object ^ Item, Platform::Object ^ ItemParent);
void ItemRemoved(winrt::Windows::Foundation::IInspectable const & Item, winrt::Windows::Foundation::IInspectable const & ItemParent);
[System.Runtime.InteropServices.DispId(276)]
public void ItemRemoved (object Item, object ItemParent);
[<System.Runtime.InteropServices.DispId(276)>]
abstract member ItemRemoved : obj * obj -> unit
Public Sub ItemRemoved (Item As Object, ItemParent As Object)

Parameters

Item
Object

Required. The item to be removed.

ItemParent
Object

Required. The item's parent.

Attributes

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  

Remarks

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

Applies to