Ejemplo n.º 1
0
 /// <summary>
 /// Gets the activator.
 /// </summary>
 /// <param name="forType">For type.</param>
 /// <param name="parameterTypes">The parameter types.</param>
 /// <returns></returns>
 protected static ActivationManager.CompiledActivator <object> GetActivator(Type forType,
                                                                            Type [] parameterTypes = null)
 {
     return(Activators.GetOrAdd(forType, type => ActivationManager.GetActivator <object>(type, parameterTypes)));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the activator.
        /// </summary>
        /// <param name="forType">For type.</param>
        /// <param name="parameterTypes">The parameter types.</param>
        /// <returns></returns>
        protected static ActivationManager.CompiledActivator <object> GetActivator(Type forType, IEnumerable <Type> parameterTypes = null)
        {
            var paramTypes = parameterTypes == null ? null : parameterTypes.ToArray();

            return(Activators.GetOrAdd(forType, type => ActivationManager.GetActivator <object>(type, paramTypes)));
        }