SharpLibEar/Manager.cs
changeset 237 1a1c2ae3a29c
parent 235 ba14a29944c4
child 243 cc2251d065db
     1.1 --- a/SharpLibEar/Manager.cs	Wed Aug 17 13:41:26 2016 +0200
     1.2 +++ b/SharpLibEar/Manager.cs	Wed Aug 17 16:39:36 2016 +0200
     1.3 @@ -57,6 +57,19 @@
     1.4              }
     1.5          }
     1.6  
     1.7 +        /// <summary>
     1.8 +        /// Trigger the given event.
     1.9 +        /// </summary>
    1.10 +        /// <param name="aEventType"></param>
    1.11 +        public void TriggerEvent<T>(T aEvent) where T : class
    1.12 +        {
    1.13 +            //Only trigger events matching the desired type
    1.14 +            foreach (Event e in Events.Where(e => e.Equals(aEvent) && e.Enabled))
    1.15 +            {
    1.16 +                e.Trigger();
    1.17 +            }
    1.18 +        }
    1.19 +
    1.20  
    1.21          /// <summary>
    1.22          /// Remove the specified action from the event it belongs too.