InPlaceHostingManager.DownloadProgressChanged 事件

定义

更改应用程序或清单下载状态时发生。

public:
 event EventHandler<System::Deployment::Application::DownloadProgressChangedEventArgs ^> ^ DownloadProgressChanged;
public event EventHandler<System.Deployment.Application.DownloadProgressChangedEventArgs> DownloadProgressChanged;
member this.DownloadProgressChanged : EventHandler<System.Deployment.Application.DownloadProgressChangedEventArgs> 
Public Custom Event DownloadProgressChanged As EventHandler(Of DownloadProgressChangedEventArgs) 
Public Event DownloadProgressChanged As EventHandler(Of DownloadProgressChangedEventArgs) 

事件类型

EventHandler<DownloadProgressChangedEventArgs>

示例

下面的代码示例演示如何更新 ToolStripProgressBar 包含在内 StatusStrip

void iphm_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
    // you can show percentage of task completed using e.ProgressPercentage
}
Private Sub iphm_DownloadProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Handles iphm.DownloadProgressChanged
    ' you can show percentage of task completed using e.ProgressPercentage
End Sub

注解

在控制台应用程序中,事件将分配给线程池中的线程。 因此,你可能会收到无序进度更新事件,后续事件显示与以前的事件相比的下降。 在基于Windows 窗体的应用程序中,不会看到此类行为,因为Windows 窗体中的事件会按顺序从用户界面 (UI) 线程的消息队列中进行处理。

适用于