EliteBGS/ProgressDialog.xaml.cs

31 lines
798 B
C#

using System.Windows;
using EliteBGS.EDDB;
namespace EliteBGS {
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class ProgressDialog : Window {
private readonly API api = null;
public ProgressDialog(API api) {
InitializeComponent();
this.api = api;
this.api.DatabaseUpdateFinished += Api_DatabaseUpdateFinished;
this.api.DatabaseUpdateProgress += Api_DatabaseUpdateProgress;
}
private void Api_DatabaseUpdateProgress() {
progress.Value = (progress.Value + 1) % 100;
}
private void Api_DatabaseUpdateFinished() {
Close();
}
public void StartDownload() {
api.Download(true);
}
}
}