Ear cleanup.
authorStephaneLenclud
Tue, 16 Aug 2016 12:25:20 +0200
changeset 2340c75dec19d39
parent 233 2b9541e54f7d
child 235 ba14a29944c4
Ear cleanup.
Server/ConsumerElectronicControl.cs
Server/FormMain.cs
Server/Properties/Settings.Designer.cs
Server/Properties/Settings.settings
SharpLibEar/Manager.cs
SharpLibEar/ManagerEventAction.cs
SharpLibEar/SharpLibEar.csproj
     1.1 --- a/Server/ConsumerElectronicControl.cs	Mon Aug 15 12:11:26 2016 +0200
     1.2 +++ b/Server/ConsumerElectronicControl.cs	Tue Aug 16 12:25:20 2016 +0200
     1.3 @@ -82,14 +82,14 @@
     1.4          {
     1.5              MonitorPowerOn = true;
     1.6              //Trigger corresponding event thus executing associated actions
     1.7 -            ManagerEventAction.Current.TriggerEvent<EventMonitorPowerOn>();            
     1.8 +            Manager.Current.TriggerEvent<EventMonitorPowerOn>();            
     1.9          }
    1.10  
    1.11          private void OnMonitorPowerOff()
    1.12          {
    1.13              MonitorPowerOn = false;
    1.14              //Trigger corresponding event thus executing associated actions
    1.15 -            ManagerEventAction.Current.TriggerEvent<EventMonitorPowerOff>();
    1.16 +            Manager.Current.TriggerEvent<EventMonitorPowerOff>();
    1.17          }
    1.18  
    1.19          /// <summary>
     2.1 --- a/Server/FormMain.cs	Mon Aug 15 12:11:26 2016 +0200
     2.2 +++ b/Server/FormMain.cs	Tue Aug 16 12:25:20 2016 +0200
     2.3 @@ -46,7 +46,7 @@
     2.4  using SharpDisplay;
     2.5  using MiniDisplayInterop;
     2.6  using SharpLib.Display;
     2.7 -using SharpLib.Ear;
     2.8 +using Ear = SharpLib.Ear;
     2.9  
    2.10  namespace SharpDisplayManager
    2.11  {
    2.12 @@ -80,7 +80,7 @@
    2.13      [System.ComponentModel.DesignerCategory("Form")]
    2.14      public partial class FormMain : FormMainHid, IMMNotificationClient
    2.15      {
    2.16 -        //public ManagerEventAction iManager = new ManagerEventAction();        
    2.17 +        //public Manager iManager = new Manager();        
    2.18          DateTime LastTickTime;
    2.19          Display iDisplay;
    2.20          System.Drawing.Bitmap iBmp;
    2.21 @@ -141,18 +141,18 @@
    2.22  
    2.23          public FormMain()
    2.24          {
    2.25 -            ManagerEventAction.Current = Properties.Settings.Default.Events;
    2.26 -            if (ManagerEventAction.Current == null)
    2.27 +            Ear.Manager.Current = Properties.Settings.Default.Events;
    2.28 +            if (Ear.Manager.Current == null)
    2.29              {
    2.30                  //No actions in our settings yet
    2.31 -                ManagerEventAction.Current = new ManagerEventAction();
    2.32 -                Properties.Settings.Default.Events = ManagerEventAction.Current;
    2.33 +                Ear.Manager.Current = new Ear.Manager();
    2.34 +                Properties.Settings.Default.Events = Ear.Manager.Current;
    2.35              }
    2.36              else
    2.37              {
    2.38                  //We loaded actions from our settings
    2.39                  //We need to hook them with corresponding events
    2.40 -                ManagerEventAction.Current.Init();
    2.41 +                Ear.Manager.Current.Init();
    2.42              }
    2.43              iSkipFrameRendering = false;
    2.44              iClosing = false;
    2.45 @@ -322,14 +322,14 @@
    2.46              buttonActionAdd.Enabled = false;
    2.47              buttonActionDelete.Enabled = false;
    2.48  
    2.49 -            Event currentEvent = CurrentEvent();
    2.50 -            SharpLib.Ear.Action currentAction = CurrentAction();
    2.51 +            Ear.Event currentEvent = CurrentEvent();
    2.52 +            Ear.Action currentAction = CurrentAction();
    2.53              TreeNode treeNodeToSelect = null;
    2.54              
    2.55              //Reset our tree
    2.56              iTreeViewEvents.Nodes.Clear();
    2.57              //Populate registered events
    2.58 -            foreach (SharpLib.Ear.Event e in ManagerEventAction.Current.Events)
    2.59 +            foreach (Ear.Event e in Ear.Manager.Current.Events)
    2.60              {
    2.61                  //Create our event node
    2.62                  TreeNode eventNode = iTreeViewEvents.Nodes.Add(e.Name);
    2.63 @@ -347,7 +347,7 @@
    2.64                  actionsNodes.ForeColor = eventNode.ForeColor;
    2.65  
    2.66                  // Add our actions for that event
    2.67 -                foreach (SharpLib.Ear.Action a in e.Actions)
    2.68 +                foreach (Ear.Action a in e.Actions)
    2.69                  {
    2.70                      TreeNode actionNode = actionsNodes.Nodes.Add(a.Brief());
    2.71                      actionNode.Tag = a;
    2.72 @@ -2765,7 +2765,7 @@
    2.73          /// 
    2.74          /// </summary>
    2.75          /// <param name="aEvent"></param>
    2.76 -        private void SelectEvent(Event aEvent)
    2.77 +        private void SelectEvent(Ear.Event aEvent)
    2.78          {
    2.79              if (aEvent == null)
    2.80              {
    2.81 @@ -2788,16 +2788,16 @@
    2.82          /// Get the current event based on event tree view selection.
    2.83          /// </summary>
    2.84          /// <returns></returns>
    2.85 -        private Event CurrentEvent()
    2.86 +        private Ear.Event CurrentEvent()
    2.87          {
    2.88              //Walk up the tree from the selected node to find our event
    2.89              TreeNode node = iTreeViewEvents.SelectedNode;
    2.90 -            Event selectedEvent = null;
    2.91 +            Ear.Event selectedEvent = null;
    2.92              while (node != null)
    2.93              {
    2.94 -                if (node.Tag is Event)
    2.95 +                if (node.Tag is Ear.Event)
    2.96                  {
    2.97 -                    selectedEvent = (Event) node.Tag;
    2.98 +                    selectedEvent = (Ear.Event) node.Tag;
    2.99                      break;
   2.100                  }
   2.101                  node = node.Parent;
   2.102 @@ -2810,12 +2810,12 @@
   2.103          /// Get the current action based on event tree view selection
   2.104          /// </summary>
   2.105          /// <returns></returns>
   2.106 -        private SharpLib.Ear.Action CurrentAction()
   2.107 +        private Ear.Action CurrentAction()
   2.108          {
   2.109              TreeNode node = iTreeViewEvents.SelectedNode;
   2.110 -            if (node != null && node.Tag is SharpLib.Ear.Action)
   2.111 +            if (node != null && node.Tag is Ear.Action)
   2.112              {
   2.113 -                return (SharpLib.Ear.Action) node.Tag;
   2.114 +                return (Ear.Action) node.Tag;
   2.115              }
   2.116  
   2.117              return null;
   2.118 @@ -2828,20 +2828,20 @@
   2.119          /// <param name="e"></param>
   2.120          private void buttonActionAdd_Click(object sender, EventArgs e)
   2.121          {
   2.122 -            Event selectedEvent = CurrentEvent();
   2.123 +            Ear.Event selectedEvent = CurrentEvent();
   2.124              if (selectedEvent == null)
   2.125              {
   2.126                  //We did not find a corresponding event
   2.127                  return;
   2.128              }
   2.129  
   2.130 -            FormEditObject<SharpLib.Ear.Action> ea = new FormEditObject<SharpLib.Ear.Action>();
   2.131 +            FormEditObject<Ear.Action> ea = new FormEditObject<Ear.Action>();
   2.132              ea.Text = "Add action";
   2.133              DialogResult res = CodeProject.Dialog.DlgBox.ShowDialog(ea);
   2.134              if (res == DialogResult.OK)
   2.135              {
   2.136                  selectedEvent.Actions.Add(ea.Object);
   2.137 -                Properties.Settings.Default.Events = ManagerEventAction.Current;
   2.138 +                Properties.Settings.Default.Events = Ear.Manager.Current;
   2.139                  Properties.Settings.Default.Save();
   2.140                  PopulateEventsTreeView();
   2.141              }
   2.142 @@ -2854,15 +2854,15 @@
   2.143          /// <param name="e"></param>
   2.144          private void buttonActionEdit_Click(object sender, EventArgs e)
   2.145          {
   2.146 -            Event selectedEvent = CurrentEvent();
   2.147 -            SharpLib.Ear.Action selectedAction = CurrentAction();
   2.148 +            Ear.Event selectedEvent = CurrentEvent();
   2.149 +            Ear.Action selectedAction = CurrentAction();
   2.150              if (selectedEvent == null || selectedAction == null)
   2.151              {
   2.152                  //We did not find a corresponding event
   2.153                  return;
   2.154              }
   2.155  
   2.156 -            FormEditObject<SharpLib.Ear.Action> ea = new FormEditObject<SharpLib.Ear.Action>();
   2.157 +            FormEditObject<Ear.Action> ea = new FormEditObject<Ear.Action>();
   2.158              ea.Text = "Edit action";
   2.159              ea.Object = selectedAction;
   2.160              int actionIndex = iTreeViewEvents.SelectedNode.Index;
   2.161 @@ -2872,7 +2872,7 @@
   2.162                  //Update our action
   2.163                  selectedEvent.Actions[actionIndex]=ea.Object;
   2.164                  //Save and rebuild our event tree view
   2.165 -                Properties.Settings.Default.Events = ManagerEventAction.Current;
   2.166 +                Properties.Settings.Default.Events = Ear.Manager.Current;
   2.167                  Properties.Settings.Default.Save();
   2.168                  PopulateEventsTreeView();
   2.169              }
   2.170 @@ -2886,15 +2886,15 @@
   2.171          private void buttonActionDelete_Click(object sender, EventArgs e)
   2.172          {
   2.173  
   2.174 -            SharpLib.Ear.Action action = CurrentAction();
   2.175 +            Ear.Action action = CurrentAction();
   2.176              if (action == null)
   2.177              {
   2.178                  //Must select action node
   2.179                  return;
   2.180              }
   2.181  
   2.182 -            ManagerEventAction.Current.RemoveAction(action);
   2.183 -            Properties.Settings.Default.Events = ManagerEventAction.Current;
   2.184 +            Ear.Manager.Current.RemoveAction(action);
   2.185 +            Properties.Settings.Default.Events = Ear.Manager.Current;
   2.186              Properties.Settings.Default.Save();
   2.187              PopulateEventsTreeView();
   2.188          }
   2.189 @@ -2906,7 +2906,7 @@
   2.190          /// <param name="e"></param>
   2.191          private void buttonActionTest_Click(object sender, EventArgs e)
   2.192          {
   2.193 -            SharpLib.Ear.Action a = CurrentAction();
   2.194 +            Ear.Action a = CurrentAction();
   2.195              if (a != null)
   2.196              {
   2.197                  a.Test();
   2.198 @@ -2921,7 +2921,7 @@
   2.199          /// <param name="e"></param>
   2.200          private void buttonActionMoveUp_Click(object sender, EventArgs e)
   2.201          {
   2.202 -            SharpLib.Ear.Action a = CurrentAction();
   2.203 +            Ear.Action a = CurrentAction();
   2.204              if (a == null || 
   2.205                  //Action already at the top of the list
   2.206                  iTreeViewEvents.SelectedNode.Index == 0)
   2.207 @@ -2930,15 +2930,15 @@
   2.208              }
   2.209  
   2.210              //Swap actions in event's action list
   2.211 -            Event currentEvent = CurrentEvent();
   2.212 +            Ear.Event currentEvent = CurrentEvent();
   2.213              int currentIndex = iTreeViewEvents.SelectedNode.Index;
   2.214 -            SharpLib.Ear.Action movingUp = currentEvent.Actions[currentIndex];
   2.215 -            SharpLib.Ear.Action movingDown = currentEvent.Actions[currentIndex-1];
   2.216 +            Ear.Action movingUp = currentEvent.Actions[currentIndex];
   2.217 +            Ear.Action movingDown = currentEvent.Actions[currentIndex-1];
   2.218              currentEvent.Actions[currentIndex] = movingDown;
   2.219              currentEvent.Actions[currentIndex-1] = movingUp;
   2.220  
   2.221              //Save and populate our tree again
   2.222 -            Properties.Settings.Default.Events = ManagerEventAction.Current;
   2.223 +            Properties.Settings.Default.Events = Ear.Manager.Current;
   2.224              Properties.Settings.Default.Save();
   2.225              PopulateEventsTreeView();
   2.226  
   2.227 @@ -2951,7 +2951,7 @@
   2.228          /// <param name="e"></param>
   2.229          private void buttonActionMoveDown_Click(object sender, EventArgs e)
   2.230          {
   2.231 -            SharpLib.Ear.Action a = CurrentAction();
   2.232 +            Ear.Action a = CurrentAction();
   2.233              if (a == null ||
   2.234                  //Action already at the bottom of the list
   2.235                  iTreeViewEvents.SelectedNode.Index == iTreeViewEvents.SelectedNode.Parent.Nodes.Count - 1)
   2.236 @@ -2960,15 +2960,15 @@
   2.237              }
   2.238  
   2.239              //Swap actions in event's action list
   2.240 -            Event currentEvent = CurrentEvent();
   2.241 +            Ear.Event currentEvent = CurrentEvent();
   2.242              int currentIndex = iTreeViewEvents.SelectedNode.Index;
   2.243 -            SharpLib.Ear.Action movingDown = currentEvent.Actions[currentIndex];
   2.244 -            SharpLib.Ear.Action movingUp = currentEvent.Actions[currentIndex + 1];
   2.245 +            Ear.Action movingDown = currentEvent.Actions[currentIndex];
   2.246 +            Ear.Action movingUp = currentEvent.Actions[currentIndex + 1];
   2.247              currentEvent.Actions[currentIndex] = movingUp;
   2.248              currentEvent.Actions[currentIndex + 1] = movingDown;
   2.249  
   2.250              //Save and populate our tree again
   2.251 -            Properties.Settings.Default.Events = ManagerEventAction.Current;
   2.252 +            Properties.Settings.Default.Events = Ear.Manager.Current;
   2.253              Properties.Settings.Default.Save();
   2.254              PopulateEventsTreeView();
   2.255          }
   2.256 @@ -2981,7 +2981,7 @@
   2.257          /// <param name="e"></param>
   2.258          private void buttonEventTest_Click(object sender, EventArgs e)
   2.259          {
   2.260 -            Event earEvent = CurrentEvent();
   2.261 +            Ear.Event earEvent = CurrentEvent();
   2.262              if (earEvent != null)
   2.263              {
   2.264                  earEvent.Test();
   2.265 @@ -3013,7 +3013,7 @@
   2.266              buttonEventEdit.Enabled =
   2.267                  CurrentEvent() != null;
   2.268  
   2.269 -            SharpLib.Ear.Action currentAction = CurrentAction();
   2.270 +            Ear.Action currentAction = CurrentAction();
   2.271              //If an action is selected enable the following buttons
   2.272              buttonActionTest.Enabled =
   2.273              buttonActionDelete.Enabled =
   2.274 @@ -3033,13 +3033,13 @@
   2.275  
   2.276          private void buttonEventAdd_Click(object sender, EventArgs e)
   2.277          {
   2.278 -            FormEditObject<SharpLib.Ear.Event> ea = new FormEditObject<SharpLib.Ear.Event>();
   2.279 +            FormEditObject<Ear.Event> ea = new FormEditObject<Ear.Event>();
   2.280              ea.Text = "Add event";
   2.281              DialogResult res = CodeProject.Dialog.DlgBox.ShowDialog(ea);
   2.282              if (res == DialogResult.OK)
   2.283              {
   2.284 -                ManagerEventAction.Current.Events.Add(ea.Object);
   2.285 -                Properties.Settings.Default.Events = ManagerEventAction.Current;
   2.286 +                Ear.Manager.Current.Events.Add(ea.Object);
   2.287 +                Properties.Settings.Default.Events = Ear.Manager.Current;
   2.288                  Properties.Settings.Default.Save();
   2.289                  PopulateEventsTreeView();
   2.290                  SelectEvent(ea.Object);
   2.291 @@ -3048,29 +3048,29 @@
   2.292  
   2.293          private void buttonEventDelete_Click(object sender, EventArgs e)
   2.294          {
   2.295 -            SharpLib.Ear.Event currentEvent = CurrentEvent();
   2.296 +            Ear.Event currentEvent = CurrentEvent();
   2.297              if (currentEvent == null)
   2.298              {
   2.299                  //Must select action node
   2.300                  return;
   2.301              }
   2.302  
   2.303 -            ManagerEventAction.Current.Events.Remove(currentEvent);
   2.304 -            Properties.Settings.Default.Events = ManagerEventAction.Current;
   2.305 +            Ear.Manager.Current.Events.Remove(currentEvent);
   2.306 +            Properties.Settings.Default.Events = Ear.Manager.Current;
   2.307              Properties.Settings.Default.Save();
   2.308              PopulateEventsTreeView();
   2.309          }
   2.310  
   2.311          private void buttonEventEdit_Click(object sender, EventArgs e)
   2.312          {
   2.313 -            Event selectedEvent = CurrentEvent();
   2.314 +            Ear.Event selectedEvent = CurrentEvent();
   2.315              if (selectedEvent == null)
   2.316              {
   2.317                  //We did not find a corresponding event
   2.318                  return;
   2.319              }
   2.320  
   2.321 -            FormEditObject<SharpLib.Ear.Event> ea = new FormEditObject<SharpLib.Ear.Event>();
   2.322 +            FormEditObject<Ear.Event> ea = new FormEditObject<Ear.Event>();
   2.323              ea.Text = "Edit event";
   2.324              ea.Object = selectedEvent;
   2.325              int actionIndex = iTreeViewEvents.SelectedNode.Index;
   2.326 @@ -3078,7 +3078,7 @@
   2.327              if (res == DialogResult.OK)
   2.328              {
   2.329                  //Save and rebuild our event tree view
   2.330 -                Properties.Settings.Default.Events = ManagerEventAction.Current;
   2.331 +                Properties.Settings.Default.Events = Ear.Manager.Current;
   2.332                  Properties.Settings.Default.Save();
   2.333                  PopulateEventsTreeView();
   2.334              }
     3.1 --- a/Server/Properties/Settings.Designer.cs	Mon Aug 15 12:11:26 2016 +0200
     3.2 +++ b/Server/Properties/Settings.Designer.cs	Tue Aug 16 12:25:20 2016 +0200
     3.3 @@ -156,9 +156,9 @@
     3.4          
     3.5          [global::System.Configuration.UserScopedSettingAttribute()]
     3.6          [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     3.7 -        public global::SharpLib.Ear.ManagerEventAction Events {
     3.8 +        public global::SharpLib.Ear.Manager Events {
     3.9              get {
    3.10 -                return ((global::SharpLib.Ear.ManagerEventAction)(this["Events"]));
    3.11 +                return ((global::SharpLib.Ear.Manager)(this["Events"]));
    3.12              }
    3.13              set {
    3.14                  this["Events"] = value;
     4.1 --- a/Server/Properties/Settings.settings	Mon Aug 15 12:11:26 2016 +0200
     4.2 +++ b/Server/Properties/Settings.settings	Tue Aug 16 12:25:20 2016 +0200
     4.3 @@ -35,7 +35,7 @@
     4.4      <Setting Name="StartIdleClient" Type="System.Boolean" Scope="User">
     4.5        <Value Profile="(Default)">True</Value>
     4.6      </Setting>
     4.7 -    <Setting Name="Events" Type="SharpLib.Ear.ManagerEventAction" Scope="User">
     4.8 +    <Setting Name="Events" Type="SharpLib.Ear.Manager" Scope="User">
     4.9        <Value Profile="(Default)" />
    4.10      </Setting>
    4.11      <Setting Name="HarmonyEnabled" Type="System.Boolean" Scope="User">
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/SharpLibEar/Manager.cs	Tue Aug 16 12:25:20 2016 +0200
     5.3 @@ -0,0 +1,81 @@
     5.4 +//
     5.5 +using System;
     5.6 +using System.Collections.Generic;
     5.7 +using System.ComponentModel;
     5.8 +using System.Linq;
     5.9 +using System.Reflection;
    5.10 +using System.Runtime.Serialization;
    5.11 +using SharpLib.Utils;
    5.12 +
    5.13 +namespace SharpLib.Ear
    5.14 +{
    5.15 +    /// <summary>
    5.16 +    /// Event Action Router (Ear) is a generic and extensible framework allowing users to execute actions in response to events. 
    5.17 +    /// Users can implement their own events and actions.
    5.18 +    /// </summary>
    5.19 +    [TypeConverter(typeof(TypeConverterJson<Manager>))]
    5.20 +    [DataContract]
    5.21 +    public class Manager
    5.22 +    {
    5.23 +        /// <summary>
    5.24 +        /// Access the currently installed EAR manager. 
    5.25 +        /// </summary>
    5.26 +        public static Manager Current = null;
    5.27 +
    5.28 +        /// <summary>
    5.29 +        /// Our events instances.
    5.30 +        /// </summary>
    5.31 +        [DataMember]
    5.32 +        public List<Event> Events;
    5.33 +
    5.34 +        /// <summary>
    5.35 +        /// Constructor
    5.36 +        /// </summary>
    5.37 +        public Manager()
    5.38 +        {
    5.39 +            Init();
    5.40 +        }
    5.41 +
    5.42 +        /// <summary>
    5.43 +        /// Executes after internalization took place.
    5.44 +        /// </summary>
    5.45 +        public void Init()
    5.46 +        {
    5.47 +            if (Events == null)
    5.48 +            {
    5.49 +                Events = new List<Event>();
    5.50 +            }
    5.51 +            
    5.52 +        }
    5.53 +
    5.54 +        /// <summary>
    5.55 +        /// Trigger the given event.
    5.56 +        /// </summary>
    5.57 +        /// <param name="aEventType"></param>
    5.58 +        public void TriggerEvent<T>() where T: class
    5.59 +        {
    5.60 +            //Only trigger enabled events matching the desired type
    5.61 +            foreach (Event e in Events.Where(e => e.GetType() == typeof(T) && e.Enabled))
    5.62 +            {
    5.63 +                e.Trigger();
    5.64 +            }
    5.65 +        }
    5.66 +
    5.67 +
    5.68 +        /// <summary>
    5.69 +        /// Remove the specified action from the event it belongs too.
    5.70 +        /// </summary>
    5.71 +        /// <param name="aAction"></param>
    5.72 +        public void RemoveAction(Action aAction)
    5.73 +        {
    5.74 +            foreach (Event e in Events)
    5.75 +            {
    5.76 +                if (e.Actions.Remove(aAction))
    5.77 +                {
    5.78 +                    //We removed our action, we are done here.
    5.79 +                    return;
    5.80 +                }
    5.81 +            }
    5.82 +        }
    5.83 +    }
    5.84 +}
    5.85 \ No newline at end of file
     6.1 --- a/SharpLibEar/ManagerEventAction.cs	Mon Aug 15 12:11:26 2016 +0200
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,78 +0,0 @@
     6.4 -//
     6.5 -
     6.6 -
     6.7 -using System;
     6.8 -using System.Collections.Generic;
     6.9 -using System.ComponentModel;
    6.10 -using System.Linq;
    6.11 -using System.Reflection;
    6.12 -using System.Runtime.Serialization;
    6.13 -using SharpLib.Utils;
    6.14 -
    6.15 -namespace SharpLib.Ear
    6.16 -{
    6.17 -    [TypeConverter(typeof(TypeConverterJson<ManagerEventAction>))]
    6.18 -    [DataContract]
    6.19 -    public class ManagerEventAction
    6.20 -    {
    6.21 -        public static ManagerEventAction Current = null;
    6.22 -        //public IDictionary<string, Type> ActionTypes;
    6.23 -        //public IDictionary<string, Type> EventTypes;
    6.24 -
    6.25 -        /// <summary>
    6.26 -        /// Our events instances.
    6.27 -        /// </summary>
    6.28 -        [DataMember]
    6.29 -        public List<Event> Events;
    6.30 -
    6.31 -
    6.32 -
    6.33 -
    6.34 -        public ManagerEventAction()
    6.35 -        {
    6.36 -            Init();
    6.37 -        }
    6.38 -
    6.39 -        /// <summary>
    6.40 -        /// Executes after internalization took place.
    6.41 -        /// </summary>
    6.42 -        public void Init()
    6.43 -        {
    6.44 -            if (Events == null)
    6.45 -            {
    6.46 -                Events = new List<Event>();
    6.47 -            }
    6.48 -            
    6.49 -        }
    6.50 -
    6.51 -        /// <summary>
    6.52 -        /// 
    6.53 -        /// </summary>
    6.54 -        /// <param name="aEventType"></param>
    6.55 -        public void TriggerEvent<T>() where T: class
    6.56 -        {
    6.57 -            //Only trigger enabled events matching the desired type
    6.58 -            foreach (Event e in Events.Where(e => e.GetType() == typeof(T) && e.Enabled))
    6.59 -            {
    6.60 -                e.Trigger();
    6.61 -            }
    6.62 -        }
    6.63 -
    6.64 -
    6.65 -        /// <summary>
    6.66 -        /// 
    6.67 -        /// </summary>
    6.68 -        /// <param name="aAction"></param>
    6.69 -        public void RemoveAction(Action aAction)
    6.70 -        {
    6.71 -            foreach (Event e in Events)
    6.72 -            {
    6.73 -                if (e.Actions.Remove(aAction))
    6.74 -                {
    6.75 -                    //We removed our action, we are done here.
    6.76 -                    return;
    6.77 -                }
    6.78 -            }
    6.79 -        }
    6.80 -    }
    6.81 -}
    6.82 \ No newline at end of file
     7.1 --- a/SharpLibEar/SharpLibEar.csproj	Mon Aug 15 12:11:26 2016 +0200
     7.2 +++ b/SharpLibEar/SharpLibEar.csproj	Tue Aug 16 12:25:20 2016 +0200
     7.3 @@ -68,7 +68,7 @@
     7.4      <Compile Include="Event.cs" />
     7.5      <Compile Include="EventMonitorPowerOff.cs" />
     7.6      <Compile Include="EventMonitorPowerOn.cs" />
     7.7 -    <Compile Include="ManagerEventAction.cs" />
     7.8 +    <Compile Include="Manager.cs" />
     7.9      <Compile Include="Properties\AssemblyInfo.cs" />
    7.10    </ItemGroup>
    7.11    <ItemGroup>