WebServicesEventsClass 类

表示 VSWebSite 对象的 WebServices 属性的事件。 使用从 WebServicesEvents 属性获取的 WebServicesEvents 对象可访问此类的功能。 不要从此类实例化。

继承层次结构

System.Object
  VsWebSite.WebServicesEventsClass

命名空间:  VsWebSite
程序集:  VsWebSite.Interop(在 VsWebSite.Interop.dll 中)

语法

声明
<ClassInterfaceAttribute()> _
<GuidAttribute("F4DD7750-F662-4430-AB7C-74F9E8EA93BF")> _
Public Class WebServicesEventsClass _
    Implements _WebServicesEvents, WebServicesEvents, _dispWebServicesEvents_Event
[ClassInterfaceAttribute()]
[GuidAttribute("F4DD7750-F662-4430-AB7C-74F9E8EA93BF")]
public class WebServicesEventsClass : _WebServicesEvents, 
    WebServicesEvents, _dispWebServicesEvents_Event
[ClassInterfaceAttribute()]
[GuidAttribute(L"F4DD7750-F662-4430-AB7C-74F9E8EA93BF")]
public ref class WebServicesEventsClass : _WebServicesEvents, 
    WebServicesEvents, _dispWebServicesEvents_Event
[<ClassInterfaceAttribute()>]
[<GuidAttribute("F4DD7750-F662-4430-AB7C-74F9E8EA93BF")>]
type WebServicesEventsClass =  
    class
        interface _WebServicesEvents
        interface WebServicesEvents
        interface _dispWebServicesEvents_Event
    end
public class WebServicesEventsClass implements _WebServicesEvents, WebServicesEvents, _dispWebServicesEvents_Event

WebServicesEventsClass 类型公开以下成员。

构造函数

  名称 说明
公共方法 WebServicesEventsClass 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。不要从此类实例化。

页首

方法

  名称 说明
公共方法 add_WebServiceAdded 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。
公共方法 add_WebServiceChanged 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。
公共方法 add_WebServiceRemoved 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。
公共方法 add_WebServiceRenamed 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。
公共方法 Equals 确定指定的 Object 是否等于当前的 Object。 (继承自 Object。)
受保护的方法 Finalize 允许对象在“垃圾回收”回收之前尝试释放资源并执行其他清理操作。 (继承自 Object。)
公共方法 GetHashCode 用作特定类型的哈希函数。 (继承自 Object。)
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
受保护的方法 MemberwiseClone 创建当前 Object 的浅表副本。 (继承自 Object。)
公共方法 remove_WebServiceAdded 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。
公共方法 remove_WebServiceChanged 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。
公共方法 remove_WebServiceRemoved 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。
公共方法 remove_WebServiceRenamed 基础结构。此方法支持 .NET Framework 基础结构,但不应在代码中直接使用。
公共方法 ToString 返回表示当前对象的字符串。 (继承自 Object。)

页首

事件

  名称 说明
公共事件 WebServiceAdded 将 Web 服务添加到 VSWebSiteEvents 对象的 WebServicesEvents 属性时发生。
公共事件 WebServiceChanged 当网站项目的 Web 服务集合中的项发生更改时发生。
公共事件 WebServiceRemoved 当从网站项目的 Web 服务集合中移除项时发生。
公共事件 WebServiceRenamed 当重命名网站项目的 Web 服务集合中的项时发生。

页首

备注

此类通过 WebServicesEvents 接口访问,该接口是从 WebServicesEvents 属性获取的。

提示

此类提供的功能在从 Visual Studio 2005 起的各个 Visual Studio 版本中均可用。 它在 Visual Web Developer 速成版中不可用。

示例

下面的宏代码示例演示如何通过开发工具扩展 (DTE2) 对象创建对当前 VSWebSite 对象的引用,以及如何订阅事件。 此示例摘自一个更大的 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 WebSvcsEvents As _
    VsWebSite.WebServicesEvents

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参见

参考

VsWebSite 命名空间

DTE

VSWebSite

VSWebSiteEvents

VSWebSiteEvents

WebServicesEvents

WebServicesEvents

其他资源

引用自动化程序集和 DTE2 对象

如何:使用宏处理事件