diff -r 4a08e1b7ba64 -r 82e87f4956ea SharpLibEar/Event.cs
--- a/SharpLibEar/Event.cs Wed Aug 31 17:28:30 2016 +0200
+++ b/SharpLibEar/Event.cs Wed Aug 31 20:20:32 2016 +0200
@@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
+using System.Linq;
using System.Runtime.Serialization;
using System.Threading.Tasks;
@@ -24,41 +25,6 @@
public bool Enabled { get; set; } = true;
- ///
- /// TODO: Should the name property be moved to our EAR Object?
- ///
- [DataMember]
- [AttributeObjectProperty
- (
- Id = "Event.Name",
- Name = "Name",
- Description = "Given event name. Can be used to trigger it."
- )
- ]
- public string Name { get; set; } = "";
-
-
- [DataMember]
- public List Actions = new List();
-
-
- protected override void DoConstruct()
- {
- base.DoConstruct();
-
- //Make sure our name is not null
- if (Name == null)
- {
- Name = "";
- }
-
- // TODO: Construct properties too
- foreach (Action a in Actions)
- {
- a.Construct();
- }
-
- }
///
@@ -74,7 +40,7 @@
public async Task Trigger()
{
Trace.WriteLine("Event triggered: " + AttributeName);
- foreach (Action action in Actions)
+ foreach (Action action in Objects.OfType())
{
await action.Execute();
}