using System.Reflection; namespace Chernobyl.Reflection.Template { /// /// An that allows for at runtime switching of /// it's implementation and makes creating new s /// easier through the use of other implementations. /// public abstract class MemberDecorator : ComponentDecorator, IMember { /// /// Initializes a new instance of the class. /// Note to implementors: this constructor immediately configures the /// using the /// method. This /// assumes the is ready to use. /// protected MemberDecorator() : this(true) { } /// /// Initializes a new instance of the class. /// /// True if this instance should be configured /// immediately, false if the /// method will be /// invoked at a later time by the implementing type. protected MemberDecorator(bool configure) : base(configure) { } /// /// The this belongs to. /// public IInstance Instance { get { return MemberImplementer.Instance; } } /// /// Information about this member. /// public MemberInfo Info { get { return MemberImplementer.Info; } } /// /// The instance that implements the /// functionality of this class. /// protected override IComponent DecoratedComponent { get { return MemberImplementer; } } /// /// The instance that implements the /// functionality of this class. /// protected abstract IMember MemberImplementer { get; } } }