Index: Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj
===================================================================
diff -u -ra670d0895ffaba9ace8c0c6e5f9a10103e61a205 -rda4d097a3f50554dda0bb688e187c2be8003de9f
--- Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision a670d0895ffaba9ace8c0c6e5f9a10103e61a205)
+++ Core/Common/src/Core.Common.Gui/Core.Common.Gui.csproj (.../Core.Common.Gui.csproj) (revision da4d097a3f50554dda0bb688e187c2be8003de9f)
@@ -379,6 +379,7 @@
Always
+
Index: Core/Common/src/Core.Common.Gui/Forms/ProgressDialog/ActivityProgressDialog.Designer.cs
===================================================================
diff -u -r231804c353b32db8e1421cfb776801a9b0677541 -rda4d097a3f50554dda0bb688e187c2be8003de9f
--- Core/Common/src/Core.Common.Gui/Forms/ProgressDialog/ActivityProgressDialog.Designer.cs (.../ActivityProgressDialog.Designer.cs) (revision 231804c353b32db8e1421cfb776801a9b0677541)
+++ Core/Common/src/Core.Common.Gui/Forms/ProgressDialog/ActivityProgressDialog.Designer.cs (.../ActivityProgressDialog.Designer.cs) (revision da4d097a3f50554dda0bb688e187c2be8003de9f)
@@ -33,20 +33,23 @@
this.buttonCancel = new System.Windows.Forms.Button();
this.labelActivityCounter = new System.Windows.Forms.Label();
this.labelActivityDescription = new System.Windows.Forms.Label();
- this.pictureBox1 = new System.Windows.Forms.PictureBox();
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
+ this.pictureBoxActivityDescription = new System.Windows.Forms.PictureBox();
+ this.pictureBoxActivityProgressText = new System.Windows.Forms.PictureBox();
+ this.labelActivityProgressText = new System.Windows.Forms.Label();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBoxActivityDescription)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBoxActivityProgressText)).BeginInit();
this.SuspendLayout();
//
// progressBar
//
- this.progressBar.Location = new System.Drawing.Point(12, 70);
+ this.progressBar.Location = new System.Drawing.Point(12, 90);
this.progressBar.Name = "progressBar";
this.progressBar.Size = new System.Drawing.Size(391, 23);
this.progressBar.TabIndex = 0;
//
// buttonCancel
//
- this.buttonCancel.Location = new System.Drawing.Point(415, 70);
+ this.buttonCancel.Location = new System.Drawing.Point(415, 90);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 1;
@@ -57,7 +60,7 @@
// labelActivityCounter
//
this.labelActivityCounter.AutoSize = true;
- this.labelActivityCounter.Location = new System.Drawing.Point(13, 51);
+ this.labelActivityCounter.Location = new System.Drawing.Point(13, 71);
this.labelActivityCounter.Name = "labelActivityCounter";
this.labelActivityCounter.Size = new System.Drawing.Size(68, 13);
this.labelActivityCounter.TabIndex = 2;
@@ -72,21 +75,41 @@
this.labelActivityDescription.TabIndex = 3;
this.labelActivityDescription.Text = "Uitvoeren \"taak\"";
//
- // pictureBox1
+ // pictureBoxActivityDescription
//
- this.pictureBox1.Image = global::Core.Common.Gui.Properties.Resources.Busy_indicator;
- this.pictureBox1.Location = new System.Drawing.Point(16, 18);
- this.pictureBox1.Name = "pictureBox1";
- this.pictureBox1.Size = new System.Drawing.Size(16, 16);
- this.pictureBox1.TabIndex = 4;
- this.pictureBox1.TabStop = false;
+ this.pictureBoxActivityDescription.Image = global::Core.Common.Gui.Properties.Resources.Busy_indicator;
+ this.pictureBoxActivityDescription.Location = new System.Drawing.Point(16, 18);
+ this.pictureBoxActivityDescription.Name = "pictureBoxActivityDescription";
+ this.pictureBoxActivityDescription.Size = new System.Drawing.Size(16, 16);
+ this.pictureBoxActivityDescription.TabIndex = 4;
+ this.pictureBoxActivityDescription.TabStop = false;
//
+ // pictureBoxActivityProgressText
+ //
+ this.pictureBoxActivityProgressText.Image = global::Core.Common.Gui.Properties.Resources.arrow_000_medium;
+ this.pictureBoxActivityProgressText.Location = new System.Drawing.Point(39, 38);
+ this.pictureBoxActivityProgressText.Name = "pictureBoxActivityProgressText";
+ this.pictureBoxActivityProgressText.Size = new System.Drawing.Size(16, 16);
+ this.pictureBoxActivityProgressText.TabIndex = 5;
+ this.pictureBoxActivityProgressText.TabStop = false;
+ //
+ // labelActivityProgressText
+ //
+ this.labelActivityProgressText.AutoSize = true;
+ this.labelActivityProgressText.Location = new System.Drawing.Point(61, 40);
+ this.labelActivityProgressText.Name = "labelActivityProgressText";
+ this.labelActivityProgressText.Size = new System.Drawing.Size(74, 13);
+ this.labelActivityProgressText.TabIndex = 6;
+ this.labelActivityProgressText.Text = "Stap 1 van 10";
+ //
// ActivityProgressDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(502, 106);
- this.Controls.Add(this.pictureBox1);
+ this.ClientSize = new System.Drawing.Size(502, 124);
+ this.Controls.Add(this.labelActivityProgressText);
+ this.Controls.Add(this.pictureBoxActivityProgressText);
+ this.Controls.Add(this.pictureBoxActivityDescription);
this.Controls.Add(this.labelActivityDescription);
this.Controls.Add(this.labelActivityCounter);
this.Controls.Add(this.buttonCancel);
@@ -102,7 +125,8 @@
this.Text = "Voortgang";
this.TopMost = true;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ActivityProgressDialogFormClosing);
- ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBoxActivityDescription)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.pictureBoxActivityProgressText)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -114,6 +138,8 @@
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Label labelActivityCounter;
private System.Windows.Forms.Label labelActivityDescription;
- private System.Windows.Forms.PictureBox pictureBox1;
+ private System.Windows.Forms.PictureBox pictureBoxActivityDescription;
+ private System.Windows.Forms.PictureBox pictureBoxActivityProgressText;
+ private System.Windows.Forms.Label labelActivityProgressText;
}
}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/Forms/ProgressDialog/ActivityProgressDialog.cs
===================================================================
diff -u -r231804c353b32db8e1421cfb776801a9b0677541 -rda4d097a3f50554dda0bb688e187c2be8003de9f
--- Core/Common/src/Core.Common.Gui/Forms/ProgressDialog/ActivityProgressDialog.cs (.../ActivityProgressDialog.cs) (revision 231804c353b32db8e1421cfb776801a9b0677541)
+++ Core/Common/src/Core.Common.Gui/Forms/ProgressDialog/ActivityProgressDialog.cs (.../ActivityProgressDialog.cs) (revision da4d097a3f50554dda0bb688e187c2be8003de9f)
@@ -12,8 +12,10 @@
public partial class ActivityProgressDialog : Form
{
private Task task;
+ private IActivity runningActivity;
private readonly IEnumerable activities;
private readonly CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
+ private readonly ProgressReporter progressReporter = new ProgressReporter();
public ActivityProgressDialog(IEnumerable activities)
{
@@ -27,7 +29,6 @@
base.OnShown(e);
var activityCount = activities.Count();
- var progressReporter = new ProgressReporter();
var cancellationToken = cancellationTokenSource.Token;
// Run all activities as part of a task
@@ -38,20 +39,33 @@
// Check for cancellation
cancellationToken.ThrowIfCancellationRequested();
- var activity = activities.ElementAt(i);
+ runningActivity = activities.ElementAt(i);
progressReporter.ReportProgress(() =>
{
// Update the activity description label
- labelActivityDescription.Text = string.Format(Resources.ActivityProgressDialog_OnShown_Executing_activity_with_name_0, activity.Name);
+ labelActivityDescription.Text = string.Format(Resources.ActivityProgressDialog_OnShown_Executing_activity_with_name_0, runningActivity.Name);
+ // Update the visibility of the activity progress text related controls
+ pictureBoxActivityProgressText.Visible = false;
+ labelActivityProgressText.Visible = false;
+
// Update the activity counter label
labelActivityCounter.Text = string.Format(Resources.ActivityProgressDialog_OnShown_Executing_step_0_of_1, i + 1, activityCount);
});
- // Run the activity
- ActivityRunner.RunActivity(activity);
+ try
+ {
+ runningActivity.ProgressChanged += ActivityOnProgressChanged;
+ // Run the activity
+ ActivityRunner.RunActivity(runningActivity);
+ }
+ finally
+ {
+ runningActivity.ProgressChanged -= ActivityOnProgressChanged;
+ }
+
progressReporter.ReportProgress(() =>
{
// Update the progress bar
@@ -99,5 +113,18 @@
// Update the activity counter label
labelActivityCounter.Text = Resources.ActivityProgressDialog_CancelActivities_Quit_after_finishing_current_activity;
}
+
+ private void ActivityOnProgressChanged(object sender, EventArgs e)
+ {
+ progressReporter.ReportProgress(() =>
+ {
+ // Update the visibility of the activity progress text related controls
+ pictureBoxActivityProgressText.Visible = true;
+ labelActivityProgressText.Visible = true;
+
+ // Update the activity progress text label
+ labelActivityProgressText.Text = string.Format(((IActivity) sender).ProgressText);
+ });
+ }
}
}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/GuiImportHandler.cs
===================================================================
diff -u -r5bdfe106fefb36f7e677da7e75afec1eba7eedd3 -rda4d097a3f50554dda0bb688e187c2be8003de9f
--- Core/Common/src/Core.Common.Gui/GuiImportHandler.cs (.../GuiImportHandler.cs) (revision 5bdfe106fefb36f7e677da7e75afec1eba7eedd3)
+++ Core/Common/src/Core.Common.Gui/GuiImportHandler.cs (.../GuiImportHandler.cs) (revision da4d097a3f50554dda0bb688e187c2be8003de9f)
@@ -1,17 +1,16 @@
using System;
using System.Collections.Generic;
using System.Drawing;
-using System.IO;
using System.Linq;
using System.Windows.Forms;
using Core.Common.Base;
using Core.Common.Base.Workflow;
using Core.Common.Controls;
using Core.Common.Gui.Forms;
+using Core.Common.Gui.Forms.ProgressDialog;
using Core.Common.Gui.Properties;
using Core.Common.Utils.Aop;
using Core.Common.Utils.IO;
-using Core.Common.Utils.Reflection;
using log4net;
using MessageBox = Core.Common.Controls.Swf.MessageBox;
@@ -170,7 +169,7 @@
importActivity.OnImportFinished += ImportActivityOnImportFinished;
- ActivityRunner.Enqueue(importActivity);
+ ActivityProgressDialogRunner.Run(importActivity);
}
private void ImportActivityOnImportFinished(FileImportActivity fileImportActivity, object importedObject, IFileImporter importer)
@@ -220,7 +219,7 @@
};
importActivity.OnImportFinished += ImportActivityOnImportFinished;
- ActivityRunner.Enqueue(importActivity);
+ ActivityProgressDialogRunner.Run(importActivity);
}
}
}
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/Properties/Resources.Designer.cs
===================================================================
diff -u -r5bdfe106fefb36f7e677da7e75afec1eba7eedd3 -rda4d097a3f50554dda0bb688e187c2be8003de9f
--- Core/Common/src/Core.Common.Gui/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 5bdfe106fefb36f7e677da7e75afec1eba7eedd3)
+++ Core/Common/src/Core.Common.Gui/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision da4d097a3f50554dda0bb688e187c2be8003de9f)
@@ -241,6 +241,16 @@
}
///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ public static System.Drawing.Bitmap arrow_000_medium {
+ get {
+ object obj = ResourceManager.GetObject("arrow_000_medium", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Documentvenster is al toegevoegd. Activeer de weergave in plaats van het toe te voegen..
///
public static string AvalonDockDockingManager_Add_View_was_already_added_activate_it_instead_of_add {
Index: Core/Common/src/Core.Common.Gui/Properties/Resources.resx
===================================================================
diff -u -r5bdfe106fefb36f7e677da7e75afec1eba7eedd3 -rda4d097a3f50554dda0bb688e187c2be8003de9f
--- Core/Common/src/Core.Common.Gui/Properties/Resources.resx (.../Resources.resx) (revision 5bdfe106fefb36f7e677da7e75afec1eba7eedd3)
+++ Core/Common/src/Core.Common.Gui/Properties/Resources.resx (.../Resources.resx) (revision da4d097a3f50554dda0bb688e187c2be8003de9f)
@@ -890,4 +890,7 @@
Huidige stap afronden, daarna annuleren...
+
+ ..\Resources\arrow-000-medium.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
\ No newline at end of file
Index: Core/Common/src/Core.Common.Gui/Resources/arrow-000-medium.png
===================================================================
diff -u
Binary files differ