/// <summary> /// Decorates all instances of T with the concrete type TDecorator /// </summary> /// <typeparam name="TDecorator"></typeparam> /// <exception cref="NotImplementedException"></exception> public void DecorateAllWith <TDecorator>() where TDecorator : T { var policy = new DecoratorPolicy <T, TDecorator>(); _parent.AddSingleton <IDecoratorPolicy>(policy); }
/// <summary> /// Decorates all instances of T with the concrete type TDecorator /// </summary> /// <typeparam name="TDecorator"></typeparam> /// <exception cref="NotImplementedException"></exception> public void DecorateAllWith <TDecorator>() where TDecorator : T { var policy = new DecoratorPolicy(typeof(T), typeof(TDecorator)); _parent.AddSingleton <IDecoratorPolicy>(policy); }
/// <summary> /// Adds a new instance policy to this container /// that can apply to every object instance created /// by this container /// </summary> /// <param name="policy"></param> public void Add(IInstancePolicy policy) { _parent.AddSingleton(policy); }