VSWebSiteEvents Arabirim
Web sitesi projesi olayları koleksiyonları erişim sağlar.
Ad alanı: VsWebSite
Derleme: VsWebSite.Interop (VsWebSite.Interop.dll içinde)
Sözdizimi
'Bildirim
<GuidAttribute("9F1B1C2C-FA11-44AB-A7DA-926FF1927C70")> _
Public Interface VSWebSiteEvents
[GuidAttribute("9F1B1C2C-FA11-44AB-A7DA-926FF1927C70")]
public interface VSWebSiteEvents
[GuidAttribute(L"9F1B1C2C-FA11-44AB-A7DA-926FF1927C70")]
public interface class VSWebSiteEvents
[<GuidAttribute("9F1B1C2C-FA11-44AB-A7DA-926FF1927C70")>]
type VSWebSiteEvents = interface end
public interface VSWebSiteEvents
VSWebSiteEvents türü aşağıdaki üyeleri ortaya koyar.
Özellikler
Ad | Açıklama | |
---|---|---|
![]() |
AssemblyReferencesEvents | Olaylar için başvuruyu alır References koleksiyonu özelliğinde bir Web sitesi projesi. |
![]() |
WebReferencesEvents | Olaylar için başvuruyu alır WebReferences koleksiyonu özelliğinde bir Web sitesi projesi. |
![]() |
WebServicesEvents | Olaylar için başvuruyu alır WebServices koleksiyonu özelliğinde bir Web sitesi projesi. |
![]() |
WebSiteMiscEvents | Bir Web sitesi projesi çeşitli olayları başvuruyu alır. |
Üst
Açıklamalar
Bu arabirim ile erişilen VSWebSiteEvents özelliği, bir VSWebSite nesnesi, yalnızca aşağıdaki örnekte olduğu gibi geçerli Visual Studio proje başvuru yoluyla elde edilebilir:
Dim ws As VsWebSite.VSWebSite = DTE.Solution.Projects.Item(1).Object
Not
Bu sınıf tarafından sağlanan işlevselliği, Visual Studio 2005 ile başlayan Visual Studio sürümlerinde kullanılabilir. Visual Web Developer Express Edition'da kullanılamaz.
Örnekler
Aşağıdaki örnek makroyu modül abone gösterilmiştir VSWebSite olayları. Modülü kullanmak için bir Web sitesi projesi Visual Studio ve açma araçları menüsü, makronun IDE açın. Yeni bir modül oluşturun ve örnek kodu modüle yapıştırın.
Ayrıca VsWebSite.Interop derlemesine bir modülü eklemeniz gerekir. İmleci koymaya tarafından olay aboneliği başlatmak InitEvents() yöntemi ve basarak F5. Her olay sınamak için Web sitesi projeniz belirtilen eylemi gerçekleştirmek. Daha fazla bilgi için, bkz. Nasıl Yapılır: Makro, Olaylar işleme
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports VsWebSite
Imports System.Diagnostics
Public Module VsWS_Events
' Initialize the VsWebSite and the Events
Sub InitAssemblyRefsEvents()
' Get a reference to the first Web site
' in the current solution
Dim ws As VsWebSite.VSWebSite = _
DTE.Solution.Projects.Item(1).Object
' Attach the Web site events to module events
AssemblyRefsEvents = _
ws.VSWebSiteEvents.AssemblyReferencesEvents
End Sub
' Declare the event
' The macro IDE requires the attribute
' in order to trap the events
<System.ContextStaticAttribute()> _
Public WithEvents AssemblyRefsEvents As _
VsWebSite.AssemblyReferencesEvents
<System.ContextStaticAttribute()> _
Public WithEvents MiscEvents As _
VsWebSite.WebSiteMiscEvents
<System.ContextStaticAttribute()> _
Public WithEvents WebRefsEvents As _
VsWebSite.WebReferencesEvents
<System.ContextStaticAttribute()> _
Public WithEvents WebSvcsEvents As _
VsWebSite.WebServicesEvents
' Handler for the AssemblyReferenceAdded event
' Test: Add an Assembly Reference to your Web site project
Private Sub AssemblyRefAdded _
(ByVal ref As VsWebSite.AssemblyReference) _
Handles AssemblyRefsEvents.AssemblyReferenceAdded
' Display the name of the added reference
MsgBox("Assembly Added: " & ref.Name)
End Sub
' Handler for the After Refresh Folder event
' Test: Refresh a folder in your Web site project
Private Sub AfterRefresh _
(ByVal ref As Object) _
Handles MiscEvents.OnAfterFolderRefresh
' Display the folder as text
MsgBox("Folder Refreshed: " & ref.ToString())
End Sub
' Handler for the Web Reference Added event
' Test: Add a Web Reference to your Web site project
Private Sub WebRefAdded _
(ByVal ref As VsWebSite.WebReference) _
Handles WebRefsEvents.WebReferenceAdded
' Display the name of the added reference
MsgBox("Web Reference Added: " & ref.Name)
End Sub
' Handler for the Web Service Added event
' Test: Add a Web service to your Web site project
Private Sub WebSvcAdded _
(ByVal ref As VsWebSite.WebService) _
Handles WebSvcsEvents.WebServiceAdded
' Display the name of the added item
MsgBox("Web Service Added: " & ref.Name)
End Sub
End Module
Ayrıca bkz.
Başvuru
VsWebSite
Diğer Kaynaklar
Otomasyon ve genişletilebilirlik Başvuru
Başvuru Otomasyon derlemeler ve DTE2 nesne