Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Events Interface

Allows access to all events in the extensibility model. Events may also be exposed from specific objects within the extensibility model.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

[GuidAttribute("134170F8-93B1-42DD-9F89-A2AC7010BA07")] 
public interface Events
/** @attribute GuidAttribute("134170F8-93B1-42DD-9F89-A2AC7010BA07") */ 
public interface Events
GuidAttribute("134170F8-93B1-42DD-9F89-A2AC7010BA07") 
public interface Events

The automation model contains a root Events object from which automation clients written in any language can reference automation events, such as the SolutionEvents.

Various IDE tools, project types, editors, and so forth may add additional events to the Events object that are specific to them. For example, Visual C++ adds the VCProjectItemsEvents property.

Public Module Module1
   Dim WithEvents bldevents As BuildEvents
   Dim applicationObject As EnvDTE.DTE

   Sub EventsExample()
      Dim addInInstance As EnvDTE.AddIn

      applicationObject = CType(Application, EnvDTE.DTE)
      bldevents = CType(applicationObject.Events.BuildEvents, EnvDTE.BuildEvents)
   End Sub

   Private Sub bldevents_OnBuildDone(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles bldevents.OnBuildDone
      MsgBox("Build complete")
   End Sub
End Module

Community Additions

ADD
Show:
© 2015 Microsoft