aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.Common/Core/FSEProgress.cs
blob: e6911fb74e2f1eecb7d0da256fd0c7123b797abf (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core;

namespace Tango.FSE.Common.Core
{
    public class FSEProgress<T> : ExtendedObject
    {
        private bool _isIndeterminate;
        public bool IsIndeterminate
        {
            get { return _isIndeterminate; }
            set { _isIndeterminate = value; RaisePropertyChangedAuto(); }
        }

        private T _value;
        public T Value
        {
            get { return _value; }
            set { _value = value; RaisePropertyChangedAuto(); }
        }

        private T _maximum;
        public T Maximum
        {
            get { return _maximum; }
            set { _maximum = value; RaisePropertyChangedAuto(); }
        }

        private String _message;
        public String Message
        {
            get { return _message; }
            set { _message = value; RaisePropertyChangedAuto(); }
        }

        public FSEProgress()
        {
            IsIndeterminate = true;
        }

        public FSEProgress(String message) : this()
        {
            Message = message;   
        }

        public FSEProgress(String message, T value, T maximum) : this(message)
        {
            IsIndeterminate = false;
            Maximum = maximum;
            Value = value;
        }
    }
}