예제 #1
0
        /// <summary>
        ///   Return handlers for components that implements the specified service.
        /// </summary>
        /// <param name = "service"> </param>
        /// <returns> </returns>
        public virtual IHandler[] GetHandlers(Type service)
        {
            var result = NamingSubSystem.GetHandlers(service);

            // If a parent kernel exists, we merge both results
            var parentResult = Parent?.GetHandlers(service);

            if (!(parentResult?.Length > 0))
            {
                return(result);
            }
            var newResult = new IHandler[result.Length + parentResult.Length];

            result.CopyTo(newResult, 0);
            parentResult.CopyTo(newResult, result.Length);
            result = newResult;

            return(result);
        }
예제 #2
0
 /// <summary>
 /// Return handlers for components that
 /// implements the specified service.
 /// </summary>
 /// <param name="service"></param>
 /// <returns></returns>
 public virtual IHandler[] GetHandlers(Type service)
 {
     return(NamingSubSystem.GetHandlers(service));
 }