DeploymentProgressChangedEventArgs Class
Represents progress data reported in an asynchronous operation.
Assembly: System.Deployment (in System.Deployment.dll)
System::EventArgs
System.ComponentModel::ProgressChangedEventArgs
System.Deployment.Application::DeploymentProgressChangedEventArgs
| Name | Description | |
|---|---|---|
![]() | BytesCompleted | Gets the number of bytes already downloaded by this operation. |
![]() | BytesTotal | Gets the total number of bytes in the download operation. |
![]() | Group | Gets the name of the file group being downloaded. |
![]() | ProgressPercentage | Gets the asynchronous task progress percentage.(Inherited from ProgressChangedEventArgs.) |
![]() | State | Gets the action that the process is currently executing. |
![]() | UserState | Gets a unique user state.(Inherited from ProgressChangedEventArgs.) |
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | MemberwiseClone() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
This class contains properties that describe progress for the CheckForUpdateProgressChanged, DownloadFileGroupProgressChanged, and UpdateProgressChanged events. Not every property in this class applies to each event.
BytesCompleted and BytesTotal represent the total number of bytes downloaded to date and the total number of bytes in the download operation, respectively; they apply to all three events. Group names the file group corresponding to the current DownloadFileGroupProgressChanged event, and State reflects the current stage of the download operation.
The following code example downloads a file group named HelpFiles, and displays download progress in a status bar. This example requires that you deploy a Windows Forms application, and that your main form has a StatusStrip control, and a ToolStripStatusLabel control named downloadStatus.
void LaunchAppUpdate() { if (ApplicationDeployment::IsNetworkDeployed) { ApplicationDeployment^ ad = ApplicationDeployment::CurrentDeployment; ad->UpdateCompleted += gcnew AsyncCompletedEventHandler(this, &Form1::LaunchAppUpdate_UpdateCompleted); ad->UpdateAsync(); } } void LaunchAppUpdate_UpdateCompleted(Object^ sender, AsyncCompletedEventArgs^ e) { if (!e->Cancelled) { if (nullptr != e->Error) { System::Windows::Forms::DialogResult dr = MessageBox::Show( "The application has been updated. Restart?", "Restart Application", MessageBoxButtons::OKCancel); if (System::Windows::Forms::DialogResult::OK == dr) { Application::Restart(); } } else { // Replace with your own error reporting or logging. MessageBox::Show( "The application encountered an error in " + "downloading the latest update. Error: {0}", e->Error->Message); } } else { // Replace with your own error reporting or logging. MessageBox::Show( "The update of the application's latest version was " + "cancelled."); } }
Available since 2.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


