WebReferencesEventsClass 类
表示 VSWebSite 的 WebReferences 属性的事件。 使用从 WebReferencesEvents 属性中获得的 WebReferencesEvents 对象访问此类的功能。 不要从此类实例化。
继承层次结构
System.Object
VsWebSite.WebReferencesEventsClass
命名空间: VsWebSite
程序集: VsWebSite.Interop(在 VsWebSite.Interop.dll 中)
语法
声明
<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
WebReferencesEventsClass 类型公开以下成员。
构造函数
名称 | 说明 | |
---|---|---|
WebReferencesEventsClass | 基础结构。仅限内部使用。此类访问 WebReferencesEvents 提供的功能。不要从此类实例化。 |
页首
方法
名称 | 说明 | |
---|---|---|
add_WebReferenceAdded | 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。 | |
add_WebReferenceChanged | 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。 | |
add_WebReferenceRemoved | 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。 | |
Equals | 确定指定的 Object 是否等于当前的 Object。 (继承自 Object。) | |
Finalize | 允许对象在“垃圾回收”回收之前尝试释放资源并执行其他清理操作。 (继承自 Object。) | |
GetHashCode | 用作特定类型的哈希函数。 (继承自 Object。) | |
GetType | 获取当前实例的 Type。 (继承自 Object。) | |
MemberwiseClone | 创建当前 Object 的浅表副本。 (继承自 Object。) | |
remove_WebReferenceAdded | 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。 | |
remove_WebReferenceChanged | 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。 | |
remove_WebReferenceRemoved | 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。 | |
ToString | 返回表示当前对象的字符串。 (继承自 Object。) |
页首
事件
名称 | 说明 | |
---|---|---|
WebReferenceAdded | 在将一个 Web 引用添加到 VSWebSiteEvents 对象的 WebReferencesEvents 属性时发生。 | |
WebReferenceChanged | 在 VSWebSiteEvents 对象的 WebReferencesEvents 属性中公开的 Web 引用发生更改时发生。 | |
WebReferenceRemoved | 在从 VSWebSiteEvents 对象的 WebServicesEvents 属性中移除 Web 引用时发生。 |
页首
备注
通过 WebReferencesEvents 接口访问此类,此接口从 WebReferencesEvents 属性中获得。
提示
此类提供的功能在从 Visual Studio 2005 起的各个 Visual Studio 版本中均可用。 它在 Visual Web Developer 速成版中不可用。
示例
下面的宏代码示例演示如何通过开发工具扩展 (DTE2) 创建对当前 VSWebSite 对象的引用以及如何订阅 Web 引用事件。 此示例摘自一个更大的 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
线程安全
此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。