Partager via


WebReferencesEventsClass Class

Represents the events for the WebReferences property of a VSWebSite. Use the WebReferencesEvents object obtained from the WebReferencesEvents property to access the functionality of this class. Do not instantiate from this class.

Inheritance Hierarchy

System.Object
  VsWebSite.WebReferencesEventsClass

Namespace:  VsWebSite
Assembly:  VsWebSite.Interop (in VsWebSite.Interop.dll)

Syntax

'Declaration
<ClassInterfaceAttribute()> _
<GuidAttribute("83121F90-51F7-452A-AF12-1EFB69B735D3")> _
Public Class WebReferencesEventsClass _
    Implements _WebReferencesEvents, WebReferencesEvents, _dispWebReferencesEvents_Event
[ClassInterfaceAttribute()]
[GuidAttribute("83121F90-51F7-452A-AF12-1EFB69B735D3")]
public class WebReferencesEventsClass : _WebReferencesEvents, 
    WebReferencesEvents, _dispWebReferencesEvents_Event
[ClassInterfaceAttribute()]
[GuidAttribute(L"83121F90-51F7-452A-AF12-1EFB69B735D3")]
public ref class WebReferencesEventsClass : _WebReferencesEvents, 
    WebReferencesEvents, _dispWebReferencesEvents_Event
[<ClassInterfaceAttribute()>]
[<GuidAttribute("83121F90-51F7-452A-AF12-1EFB69B735D3")>]
type WebReferencesEventsClass =  
    class 
        interface _WebReferencesEvents 
        interface WebReferencesEvents 
        interface _dispWebReferencesEvents_Event 
    end
public class WebReferencesEventsClass implements _WebReferencesEvents, WebReferencesEvents, _dispWebReferencesEvents_Event

The WebReferencesEventsClass type exposes the following members.

Constructors

  Name Description
Public method WebReferencesEventsClass Infrastructure. For internal use only. This class accesses the functionality provided by WebReferencesEvents. Do not instantiate from this class.

Top

Methods

  Name Description
Public method add_WebReferenceAdded Infrastructure. This method supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Public method add_WebReferenceChanged Infrastructure. This method supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Public method add_WebReferenceRemoved Infrastructure. This method supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method remove_WebReferenceAdded Infrastructure. This method supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Public method remove_WebReferenceChanged Infrastructure. This method supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Public method remove_WebReferenceRemoved Infrastructure. This method supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Events

  Name Description
Public event WebReferenceAdded Occurs when a Web reference is added to the WebReferencesEvents property of a VSWebSiteEvents object.
Public event WebReferenceChanged Occurs when a Web reference exposed in the WebReferencesEvents property of a VSWebSiteEvents object has changed.
Public event WebReferenceRemoved Occurs when a Web reference is removed from the WebServicesEvents property of a VSWebSiteEvents object.

Top

Remarks

This class is accessed through the WebReferencesEvents interface, which is obtained from the WebReferencesEvents property.

Note

The functionality provided by this class is available in versions of Visual Studio starting with Visual Studio 2005. It is not available in Visual Web Developer Express Edition.

Examples

The following macro code example shows how to create a reference to the current VSWebSite object through the Development Tools Extensibility (DTE2) and how to subscribe to a Web reference event. This sample is part of a larger code sample for VSWebSiteEvents.

' 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 WebRefsEvents As _
    VsWebSite.WebReferencesEvents

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

VsWebSite Namespace

DTE

VSWebSite

VSWebSiteEvents

VSWebSiteEvents

WebReferencesEvents

WebReferencesEvents

Other Resources

Referencing Automation Assemblies and the DTE2 Object

How to: Handle Events in a Macro