共用方式為


PublishEventsClass.OnPublishBegin 事件

這個 API 支援 .NET Framework 基礎結構,但您不可以直接在程式碼中使用它。

發行作業開始時所觸發 (Trigger) 的事件。

命名空間:  EnvDTE80
組件:  EnvDTE80 (在 EnvDTE80.dll 中)

語法

'宣告
Public Overridable Event OnPublishBegin As _dispPublishEvents_OnPublishBeginEventHandler
public virtual event _dispPublishEvents_OnPublishBeginEventHandler OnPublishBegin
public:
virtual  event _dispPublishEvents_OnPublishBeginEventHandler^ OnPublishBegin {
    void add (_dispPublishEvents_OnPublishBeginEventHandler^ value);
    void remove (_dispPublishEvents_OnPublishBeginEventHandler^ value);
}
abstract OnPublishBegin : IEvent<_dispPublishEvents_OnPublishBeginEventHandler,
    EventArgs>
override OnPublishBegin : IEvent<_dispPublishEvents_OnPublishBeginEventHandler,
    EventArgs>
JScript 不支援事件。

實作

_dispPublishEvents_Event.OnPublishBegin

備註

Visual Studio 會包含稱為「ClickOnce 部署」的新功能。ClickOnce 允許您將 Windows 應用程式發行至 Web 伺服器或網路檔案,以共用的方式提供簡易安裝。如需詳細資訊,請參閱 ClickOnce 安全性和部署

範例

Public Class Connect
    Implements IDTExtensibility2
    Public WithEvents pubEvents As EnvDTE80.PublishEvents

    Dim applicationObject As DTE2
    Dim addInInstance As AddIn

    Public Sub OnConnection(ByVal application As Object, ByVal _
    connectMode As ext_ConnectMode, ByVal addInInst As Object, ByRef _
    custom As Array) 
    Implements IDTExtensibility2.OnConnection
        Try
            applicationObject = CType(application, DTE2)
            addInInstance = CType(addInInst, AddIn)
            Dim events As EnvDTE80.Events2
            events = applicationObject.Events2
            pubEvents = CType(events._PublishEvents(Nothing), _
            EnvDTE80.PublishEvents)
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub

    Private Sub pubEvents_OnPublishBegin(ByRef [Continue] As Boolean) _
    Handles pubEvents.OnPublishBegin
        MsgBox("A publish event is occuring..")
    End Sub

    Private Sub pubEvents_OnPublishDone(ByVal Success As Boolean) _
    Handles pubEvents.OnPublishDone
        MsgBox("A publish event has completed.")
    End Sub

.NET Framework 安全性

請參閱

參考

PublishEventsClass 類別

EnvDTE80 命名空間

其他資源

HOW TO:編譯和執行 Automation 物件模型程式碼範例

HOW TO:回應 ClickOnce 發行事件