diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-12-19 10:25:40 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-12-19 10:25:40 +0200 |
| commit | afc7a07d285e08d905c58dd5978441c155b2f296 (patch) | |
| tree | a2f4f51ef2747ae3a2aded2637a352ce8ef85934 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications | |
| parent | ad35c9c2df0001157ea13312382f3cdfdad67f06 (diff) | |
| download | Tango-afc7a07d285e08d905c58dd5978441c155b2f296.tar.gz Tango-afc7a07d285e08d905c58dd5978441c155b2f296.zip | |
MERGE.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications')
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(); + } + } +} |
