VSProjectEvents.ReferencesEvents-Eigenschaft
Ruft ein ReferencesEvents-Objekt ab, das Zugriff auf die Ereignisse der References-Auflistung ermöglicht.
Namespace: VSLangProj
Assembly: VSLangProj (in vslangproj.dll)
Syntax
'Declaration
ReadOnly Property ReferencesEvents As ReferencesEvents
'Usage
Dim instance As VSProjectEvents
Dim value As ReferencesEvents
value = instance.ReferencesEvents
ReferencesEvents ReferencesEvents { get; }
property ReferencesEvents^ ReferencesEvents {
ReferencesEvents^ get ();
}
/** @property */
ReferencesEvents get_ReferencesEvents ()
function get ReferencesEvents () : ReferencesEvents
Eigenschaftenwert
Gibt ein ReferencesEvents-Objekt zurück.
Hinweise
Die ReferencesEvents-Eigenschaft ermöglicht Zugriff auf drei Ereignisse: ReferenceAdded, ReferenceChanged und ReferenceRemoved.
Beispiel
In diesem Beispiel werden Ereignisbehandlungsmethoden für ein bestimmtes Projekt unter Verwendung der ReferencesEvents-Eigenschaft verbunden.
' 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
Siehe auch
Referenz
VSProjectEvents-Schnittstelle
VSProjectEvents-Member
VSLangProj-Namespace