Compartir a través de


VSProjectEvents.ReferencesEvents (Propiedad)

Actualización: noviembre 2007

Obtiene un objeto ReferencesEvents que proporciona acceso a los eventos de la colección References.

Espacio de nombres:  VSLangProj
Ensamblado:  VSLangProj (en VSLangProj.dll)

Sintaxis

ReadOnly Property ReferencesEvents As ReferencesEvents

Dim instance As VSProjectEvents
Dim value As ReferencesEvents

value = instance.ReferencesEvents
ReferencesEvents ReferencesEvents { get; }
property ReferencesEvents^ ReferencesEvents {
    ReferencesEvents^ get ();
}
function get ReferencesEvents () : ReferencesEvents

Valor de propiedad

Tipo: VSLangProj.ReferencesEvents

Devuelve un objeto ReferencesEvents.

Comentarios

La propiedad ReferencesEvents proporciona acceso a tres eventos: ReferenceAdded, ReferenceChanged y ReferenceRemoved.

Ejemplos

Este ejemplo conecta métodos de control de eventos para un proyecto específico por medio de la propiedad ReferencesEvents.

' Macro Editor
' Connects trivial methods to the ReferenceAdded and ReferenceDeleted
' events of the first project in the solution.
Imports VSLangProj
Sub ConnectEvents()
   Dim proj As Project = DTE.Solution.Projects.Item(1)
   Dim vsproj As VSProject = CType(proj.Object, VSProject)
   Dim refEvents As ReferencesEvents = vsproj.Events.ReferencesEvents
   AddHandler refEvents.ReferenceAdded, AddressOf ReferenceAdded
   AddHandler refEvents.ReferenceRemoved, AddressOf ReferenceRemoved
   AddHandler refEvents.ReferenceChanged, AddressOf ReferenceChanged
End Sub

Sub ReferenceRemoved(ByVal removedRef As Reference)
   MsgBox("The reference for " & removedRef.Name & " was removed.")
End Sub

Sub ReferenceChanged(ByVal removedRef As Reference)
   MsgBox("The reference for " & removedRef.Name & " was changed.")
End Sub

Sub ReferenceAdded(ByVal addedRef As Reference)
   MsgBox("The reference for " & addedRef.Name & " was added.")
End Sub

Permisos

Vea también

Referencia

VSProjectEvents (Interfaz)

VSProjectEvents (Miembros)

VSLangProj (Espacio de nombres)