blob: f4192afeda3bb0d6e45abe993b53d0990a7e6947 (
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.BL.Enumerations;
using Tango.Core;
using Tango.Core.DI;
using Tango.FSE.BL;
using Tango.FSE.Common.FSEApplication;
using Tango.FSE.Common.Notifications;
using Tango.Integration.Operation;
using Tango.PMR.Diagnostics;
namespace Tango.FSE.Common.Connection
{
/// <summary>
/// Represents the default machine events state provider.
/// </summary>
/// <seealso cref="Tango.Integration.Operation.IMachineEventsStateProvider" />
public class FSEMachineEventsStateProvider : ExtendedObject, IMachineEventsStateProvider
{
private static Dictionary<EventTypes, Tango.BL.Entities.EventType> _eventTypesGuids;
private bool _initialized;
[TangoInject(TangoInjectMode.WhenAvailable)]
private FSEServicesContainer Services { get; set; }
[TangoInject(TangoInjectMode.WhenAvailable)]
private INotificationProvider NotificationProvider { get; set; }
private ReadOnlyObservableCollection<MachinesEvent> _events;
/// <summary>
/// Gets the current machine events.
/// </summary>
public ReadOnlyObservableCollection<MachinesEvent> Events
{
get
{
return _events;
}
private set
{
_events = value;
RaisePropertyChangedAuto();
RaisePropertyChanged(nameof(HasEvents));
}
}
/// <summary>
/// Gets or sets a value indicating whether this instance has events.
/// </summary>
public bool HasEvents
{
get
{
return Events.Count > 0;
}
}
/// <summary>
/// Occurs when new events are available.
/// </summary>
public event EventHandler<IEnumerable<MachinesEvent>> NewEvents;
/// <summary> |