VSProjectEvents.ImportsEvents 속성
Imports 개체 이벤트에 대한 액세스를 제공하는 ImportsEvents 개체를 가져옵니다.
네임스페이스: VSLangProj
어셈블리: VSLangProj(vslangproj.dll)
구문
‘선언
ReadOnly Property ImportsEvents As ImportsEvents
‘사용 방법
Dim instance As VSProjectEvents
Dim value As ImportsEvents
value = instance.ImportsEvents
ImportsEvents ImportsEvents { get; }
property ImportsEvents^ ImportsEvents {
ImportsEvents^ get ();
}
/** @property */
ImportsEvents get_ImportsEvents ()
function get ImportsEvents () : ImportsEvents
속성 값
ImportsEvents 개체를 반환합니다.
설명
ImportsEvents 개체는 ImportAdded 및 ImportRemoved 이벤트에 대한 액세스를 제공합니다.
예제
이 예제에서는 Events 개체를 사용하여 특정 프로젝트에 대한 ImportAdded 및 ImportRemoved에 이벤트 처리 메서드를 연결합니다.
' Macro editor
' This example adds event handlers to the two events in
' ImportsEvents.
Imports VSLangProj
Sub ImportAdded(ByVal addedImport As String)
MsgBox("The import '" & addedImport & "' was added.")
End Sub
Sub ImportRemoved(ByVal removedImport As String)
MsgBox("The import '" & removedImport & "' was removed.")
End Sub
Sub ConnectImportsEvents()
Dim proj As Project = DTE.Solution.Projects.Item(1)
Dim vsproj As VSProject = CType(proj.Object, VSProject)
Dim impEvents As ImportsEvents = vsproj.Events.ImportsEvents
AddHandler impEvents.ImportAdded, AddressOf ImportAdded
AddHandler impEvents.ImportRemoved, AddressOf ImportRemoved
End Sub