aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/EmulateMachineEventDialogViewVM.cs
blob: 0026a47ff86790a15cdcbab822467faeaf7c73c9 (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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.FSE.Common;

namespace Tango.FSE.UI.Dialogs
{
    public class EmulateMachineEventDialogViewVM : FSEDialogViewVM
    {
        public List<EventType> EventTypes { get; set; }

        private EventType _selectedEventType;
        public EventType SelectedEventType
        {
            get { return _selectedEventType; }
            set { _selectedEventType = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); }
        }

        private int _durationSeconds;
        public int DurationSeconds
        {
            get { return _durationSeconds; }
            set { _durationSeconds = value; RaisePropertyChangedAuto(); }
        }

        public String Message { get; set; }

        public EmulateMachineEventDialogViewVM()
        {
            EventTypes = new List<EventType>();
            DurationSeconds = 5;
        }

        protected override bool CanOK()
        {
            return base.CanOK() && SelectedEventType != null && DurationSeconds > 0;
        }
    }
}