Exemplo n.º 1
0
        /// <summary>
        ///     Register a Func to potentially enrich or substitute for the object
        ///     created by this Instance before it is returned to the caller
        /// </summary>
        /// <param name="handler"></param>
        /// <returns></returns>
        public SmartInstance <T> EnrichWith(ContextEnrichmentHandler <T> handler)
        {
            var interceptor = new EnrichmentInterceptor <T>(handler);

            Interceptor = interceptor;

            return(this);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Register a Func to potentially enrich or substitute for the object
        ///     created by this Instance before it is returned to the caller
        /// </summary>
        /// <param name="handler"></param>
        /// <returns></returns>
        public SmartInstance <T> EnrichWith <TPluginType>(EnrichmentHandler <TPluginType> handler)
        {
            var interceptor = new EnrichmentInterceptor <TPluginType>((c, o) => handler(o));

            Interceptor = interceptor;

            return(this);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Register a Func to potentially enrich or substitute for the object
        /// created by this Instance before it is returned to the caller
        /// </summary>
        /// <param name="handler"></param>
        /// <returns></returns>
        public SmartInstance <T> EnrichWith <PLUGINTYPE>(EnrichmentHandler <PLUGINTYPE> handler)
        {
            var interceptor = new EnrichmentInterceptor <PLUGINTYPE>((c, o) => handler(o));

            Interceptor = interceptor;

            return(this);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Register a Func to potentially enrich or substitute for the object
        /// created by this Instance before it is returned to the caller
        /// </summary>
        /// <typeparam name="TYPE"></typeparam>
        /// <param name="handler"></param>
        /// <returns></returns>
        public T EnrichWith <TYPE>(ContextEnrichmentHandler <TYPE> handler)
        {
            var interceptor = new EnrichmentInterceptor <TYPE>(handler);

            Interceptor = interceptor;

            return(thisInstance);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Register a Func to potentially enrich or substitute for the object
        /// created by this Instance before it is returned to the caller
        /// </summary>
        /// <typeparam name="TYPE"></typeparam>
        /// <param name="handler"></param>
        /// <returns></returns>
        public T EnrichWith <TYPE>(EnrichmentHandler <TYPE> handler)
        {
            var interceptor = new EnrichmentInterceptor <TYPE>((c, o) => handler(o));

            Interceptor = interceptor;

            return(thisInstance);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Register a Func to potentially enrich or substitute for the object
        /// created by this Instance before it is returned to the caller
        /// </summary>
        /// <param name="handler"></param>
        /// <returns></returns>
        public ConfiguredInstance EnrichWith <T>(ContextEnrichmentHandler <T> handler)
        {
            var interceptor = new EnrichmentInterceptor <T>(handler);

            Interceptor = interceptor;

            return(this);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Register a Func to potentially enrich or substitute for the object
        /// created by this Instance before it is returned to the caller
        /// </summary>
        /// <param name="handler"></param>
        /// <returns></returns>
        public ConfiguredInstance EnrichWith <T>(EnrichmentHandler <T> handler)
        {
            var interceptor = new EnrichmentInterceptor <T>((c, o) => handler(o));

            Interceptor = interceptor;

            return(this);
        }