aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs30
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/TaskItem.cs41
2 files changed, 69 insertions, 2 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs
index e14df21ba..a45f9a847 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/INotificationProvider.cs
@@ -1,17 +1,43 @@
using MaterialDesignThemes.Wpf;
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
+using System.Windows.Media;
namespace Tango.MachineStudio.Common.Notifications
{
public interface INotificationProvider
{
- bool ShowDialog<T>(PackIconKind icon, String title, object context) where T : FrameworkElement;
+ ObservableCollection<TaskItem> TaskItems { get; }
- bool ShowDialog(PackIconKind icon, String title, FrameworkElement content, object context);
+ TaskItem CurrentTaskItem { get; }
+
+ bool HasTaskItems { get; }
+
+ void PushTaskItem(TaskItem taskItem);
+
+ TaskItem PushTaskItem(String message);
+
+ void PopTaskItem(TaskItem taskItem);
+
+ bool? ShowModalWindow(Window window);
+
+ bool ShowModalWindow<T>(PackIconKind icon, String title, object context) where T : FrameworkElement;
+
+ bool ShowModalWindow(PackIconKind icon, String title, FrameworkElement content, object context);
+
+ bool? ShowDialog(PackIconKind icon, Brush iconColor, String message, bool hasCancel);
+
+ void ShowInfo(String message);
+
+ void ShowWarnning(String message);
+
+ void ShowError(String message);
+
+ bool ShowQuestion(String message);
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/TaskItem.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/TaskItem.cs
new file mode 100644
index 000000000..0cf5e2c8e
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/TaskItem.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Core;
+
+namespace Tango.MachineStudio.Common.Notifications
+{
+ public class TaskItem : ExtendedObject, IDisposable
+ {
+ private INotificationProvider _notificationProvider;
+
+ public TaskItem(INotificationProvider notificationProvider)
+ {
+ _notificationProvider = notificationProvider;
+ }
+
+ private String _message;
+ public String Message
+ {
+ get { return _message; }
+ set { _message = value; RaisePropertyChangedAuto(); }
+ }
+
+ public void Pop()
+ {
+ _notificationProvider.PopTaskItem(this);
+ }
+
+ public void Push()
+ {
+ _notificationProvider.PushTaskItem(this);
+ }
+
+ public void Dispose()
+ {
+ Pop();
+ }
+ }
+}