aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Notifications/TaskItem.cs
blob: 0cf5e2c8e91d31f0d58dc1bbcd84b14cbfaaa559 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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();
        }
    }
}