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