StephaneLenclud@209: // StephaneLenclud@209: StephaneLenclud@209: StephaneLenclud@209: using System; StephaneLenclud@209: using System.Collections.Generic; StephaneLenclud@209: using System.Linq; StephaneLenclud@209: using System.Reflection; StephaneLenclud@209: using System.Runtime.Serialization; StephaneLenclud@209: StephaneLenclud@209: namespace Slions.Ear StephaneLenclud@209: { StephaneLenclud@209: public static class ReflectiveEnumerator StephaneLenclud@209: { StephaneLenclud@209: static ReflectiveEnumerator() { } StephaneLenclud@209: StephaneLenclud@209: public static IEnumerable GetEnumerableOfType() where T : class StephaneLenclud@209: { StephaneLenclud@209: List objects = new List(); StephaneLenclud@209: foreach (Type type in StephaneLenclud@209: Assembly.GetAssembly(typeof(T)).GetTypes() StephaneLenclud@209: .Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(T)))) StephaneLenclud@209: { StephaneLenclud@209: objects.Add((T)Activator.CreateInstance(type)); StephaneLenclud@209: } StephaneLenclud@209: //objects.Sort(); StephaneLenclud@209: return objects; StephaneLenclud@209: } StephaneLenclud@209: } StephaneLenclud@209: StephaneLenclud@209: StephaneLenclud@209: [DataContract] StephaneLenclud@209: class Manager StephaneLenclud@209: { StephaneLenclud@209: private IEnumerable Actions; StephaneLenclud@209: private IEnumerable Events; StephaneLenclud@209: StephaneLenclud@209: public Manager() StephaneLenclud@209: { StephaneLenclud@209: Actions = ReflectiveEnumerator.GetEnumerableOfType(); StephaneLenclud@209: Events = ReflectiveEnumerator.GetEnumerableOfType(); StephaneLenclud@209: StephaneLenclud@209: //CollectActions(); StephaneLenclud@209: //CollectEvents(); StephaneLenclud@209: } StephaneLenclud@209: StephaneLenclud@209: StephaneLenclud@209: StephaneLenclud@209: } StephaneLenclud@209: }