using System; using System.Collections.Generic; using System.Linq; using Encompass.Exceptions; namespace Encompass { [AttributeUsage(AttributeTargets.Class)] public class ReadsPending : Attribute { public readonly HashSet readPendingTypes = new HashSet(); public ReadsPending(params Type[] readPendingTypes) { foreach (var readPendingType in readPendingTypes) { var isComponent = readPendingType.GetInterfaces().Contains(typeof(IComponent)); if (!isComponent) { throw new IllegalReadTypeException("{0} must be a Component", readPendingType.Name); } this.readPendingTypes.Add(readPendingType); } } } }