SharpLibEar/Action.cs
changeset 212 1a0791daa243
parent 211 96f8b4dc4300
child 220 e5910d7b6a81
     1.1 --- a/SharpLibEar/Action.cs	Sat Jul 23 19:22:56 2016 +0200
     1.2 +++ b/SharpLibEar/Action.cs	Sun Jul 24 13:30:08 2016 +0200
     1.3 @@ -2,12 +2,14 @@
     1.4  
     1.5  
     1.6  using System;
     1.7 +using System.Collections.Generic;
     1.8  using System.Runtime.Serialization;
     1.9  using System.Threading;
    1.10  
    1.11  namespace SharpLib.Ear
    1.12  {
    1.13      [DataContract]
    1.14 +    [KnownType("DerivedTypes")]
    1.15      public abstract class Action: IComparable
    1.16      {
    1.17          public abstract void Execute();
    1.18 @@ -23,6 +25,12 @@
    1.19              //Sort by action name
    1.20              return Utils.Reflection.GetAttribute<AttributeAction>(GetType()).Name.CompareTo(obj.GetType());            
    1.21          }
    1.22 +
    1.23 +        private static IEnumerable<Type> DerivedTypes()
    1.24 +        {
    1.25 +            return SharpLib.Utils.Reflection.GetDerivedTypes<Action>();
    1.26 +        }
    1.27 +
    1.28      }
    1.29  
    1.30