CodeModelEventsClass::ElementChanged Event

 

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

Raised when a CodeElement object has been changed.

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

public:
event _dispCodeModelEvents_ElementChangedEventHandler^ ElementChanged {
	virtual void add(_dispCodeModelEvents_ElementChangedEventHandler^ value);
	virtual void remove(_dispCodeModelEvents_ElementChangedEventHandler^ value);
}

Only one ElementChanged event occurs for any given change in the code. The "most local" object raises the event. For example, if a method’s access is changed, the ElementChanged event would be fired for that CodeMethod object only. There would not be an event raised for the containing CodeClass object.

System_CAPS_noteNote

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.

Dim WithEvents oCodeModelEvents As EnvDTE80.CodeModelEvents
Public Sub OnCodeElementChanged(ByVal Element As EnvDTE.CodeElement, _
  ByVal Change As EnvDTE80.vsCMChangeKind) Handles _
  oCodeModelEvents.ElementChanged
    MsgBox(Element.Name + "(Kind=" + Str(Element.Kind) + ") was _
      changed (change=" + Str(Change) + ").")
End Sub
Return to top
Show: