CodeModelEventsClass.ElementDeleted Event

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

Raised when a CodeElement is deleted.

Namespace:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Syntax

'Declaration
Public Overridable Event ElementDeleted As _dispCodeModelEvents_ElementDeletedEventHandler
public virtual event _dispCodeModelEvents_ElementDeletedEventHandler ElementDeleted
public:
virtual   event _dispCodeModelEvents_ElementDeletedEventHandler^ ElementDeleted {
    void add (_dispCodeModelEvents_ElementDeletedEventHandler^ value);
    void remove (_dispCodeModelEvents_ElementDeletedEventHandler^ value);
}
abstract ElementDeleted : IEvent<_dispCodeModelEvents_ElementDeletedEventHandler,
    CodeElement>
override ElementDeleted : IEvent<_dispCodeModelEvents_ElementDeletedEventHandler,
    CodeElement>
JScript does not support events.

Implements

_dispCodeModelEvents_Event.ElementDeleted

Remarks

Note

The values of code model elements such as classes, structs, functions, attributes, delegates, and so forth can be non-deterministic after making certain kinds of edits, meaning that their values cannot be relied upon to always remain the same. For more information, see the section Code Model Element Values Can Change in Discovering Code by Using the Code Model (Visual Basic).

Examples

Dim WithEvents oCodeModelEvents As EnvDTE80.CodeModelEvents
Private Sub OnCodeElementDeleted(ByVal Parent As Object, ByVal _
  Element As EnvDTE.CodeElement) Handles _
  oCodeModelEvents.ElementDeleted
    MsgBox(Element.Name + "(Kind=" + Str(Element.Kind) + ") was _
      removed.")
End Sub

.NET Framework Security

See Also

Reference

CodeModelEventsClass Class

EnvDTE80 Namespace

Other Resources

How to: Compile and Run the Automation Object Model Code Examples

Discovering Code by Using the Code Model (Visual Basic)

Discovering Code by Using the Code Model (Visual C#)