Interaction logic for ProgressDialog.xaml
Esempio n. 1
0
 static IProgressNotifier DialogViewModel(Window owner, Action cancelAction)
 {
     var dialog = new ProgressDialog(owner);
     dialog.Closed += (sender, args) => cancelAction();
     var dialogViewModel = new ProgressDialogViewModel(cancelAction, dialog.Show, dialog.Close);
     dialog.DataContext = dialogViewModel;
     return dialogViewModel;
 }
Esempio n. 2
0
 void OpenServerLogFile(object o)
 {
     WebClient client = new WebClient { Credentials = CurrentEnvironment.Connection.HubConnection.Credentials };
     var dialog = new ProgressDialog();
     _progressDialogViewModel = new ProgressDialogViewModel(() => { dialog.Close(); }, delegate
     {
         dialog.Show();
     }, delegate
     {
         dialog.Close();
     });
     _progressDialogViewModel.StatusChanged("Server Log File", 0, 0);
     _progressDialogViewModel.SubLabel = "Preparing to download Warewolf Server log file.";
     dialog.DataContext = _progressDialogViewModel;
     _progressDialogViewModel.Show();
     client.DownloadProgressChanged += DownloadProgressChanged;
     client.DownloadFileCompleted += DownloadFileCompleted;
     var managementServiceUri = WebServer.GetInternalServiceUri("getlogfile", CurrentEnvironment.Connection);
     _serverLogFile = Path.Combine(GlobalConstants.TempLocation, CurrentEnvironment.Connection.DisplayName + " Server Log.txt");
     client.DownloadFileAsync(managementServiceUri, _serverLogFile);
    
 }