Ejemplo n.º 1
0
            /// <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);
            }
Ejemplo n.º 2
0
            /// <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);
            }
Ejemplo n.º 3
0
 /// <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);
 }