/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }